int main() { while(~scanf("%d", &n)) { readMatrix(a); readMatrix(b); readMatrix(c); for(int i=0;i<n;++i) x[i] = i; mutiply(x, a, d); mutiply(d, b, e); mutiply(x, c, f); if(equal(e, f)) printf("YES\n"); else printf("NO\n"); } return 0; }
vec3& vec3::operator*=(const vec3& other) { return mutiply(other); }
vec2& vec2::operator*=(const vec2& other) { return mutiply(other); }
vec4& vec4::operator*=(const vec4& other) { return mutiply(other); }