#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() using ll = long long; const ll MOD = 998244353; #include using namespace atcoder; using mint = modint998244353; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll a11,a12,a21,a22,b11,b12,b21,b22;cin>>a11>>a12>>a21>>a22>>b11>>b12>>b21>>b22; struct Mat{ ll a,b,c,d; bool operator==(const Mat& other) const { return a == other.a && b == other.b && c == other.c && d == other.d; } }; Mat A={a11,a12,a21,a22},B={b11,b12,b21,b22}; auto check=[](Mat A){ if(A.a*A.d-A.b*A.c==0)return false; return true; }; auto Pro=[](Mat A,Mat B){ Mat C; C.a=(A.a*B.a+A.b*B.c)%67; C.b=(A.a*B.b+A.b*B.d)%67; C.c=(A.c*B.a+A.d*B.c)%67; C.d=(A.c*B.b+A.d*B.d)%67; return C; }; rep(i,67)rep(j,67)rep(k,67)rep(l,67){ Mat C={i,j,k,l}; if(check(C)&&(Pro(C,A)==Pro(B,C))){ cout<<"Yes"<