#include #include using namespace std; using namespace atcoder; using ll = long long; using mint=modint998244353; using ld = long double; const ll infl = 1LL << 60; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const vector dx = {1, 0, -1, 0}; const vector dy = {0, 1, 0, -1}; template using vc = vector; template using vvc = vc>; template using vvvc = vc>; using vi = vc; using vvi = vvc; using vl = vc; using vvl = vvc; using vvvl = vvc; using vvvvl = vvc; using vs = vc; using vvs = vvc; using P = pair; #define nrep(i,n) for (ll i = 0; i < (n); ++i) #define nfor(i,s,n) for(ll i=s;i using pq = priority_queue>;//★大きい順に取り出す コスト,頂点 bfs系で使う 小さい順じゃないですABC305E template using pq_g = priority_queue, greater>;//小さい順に取り出す ダイクストラ法で使う #define cout(n) cout<> a[0][0] >> a[0][1] >> a[1][0] >> a[1][1]; cin >> b[0][0] >> b[0][1] >> b[1][0] >> b[1][1]; for(short i = 0; i <= 66; i++) { for(short j = 0; j <= 66; j++) { for(short k = 0; k <= 66; k++) { for(short l = 0; l <= 66; l++) { if(i*j - k*l == 0) continue; short pa00 = (i*a[0][0] + j*a[1][0]) % 67; short pa01 = (i*a[0][1] + j*a[1][1]) % 67; short pa10 = (k*a[0][0] + l*a[1][0]) % 67; short pa11 = (k*a[0][1] + l*a[1][1]) % 67; short bp00 = (b[0][0]*i + b[0][1]*k) % 67; short bp01 = (b[0][0]*j + b[0][1]*l) % 67; short bp10 = (b[1][0]*i + b[1][1]*k) % 67; short bp11 = (b[1][0]*j + b[1][1]*l) % 67; if(pa00==bp00 && pa01==bp01 && pa10==bp10 && pa11==bp11) { cout << "Yes" << endl; return 0; } } } } } cout << "No" << endl; // auto end = chrono::system_clock::now(); // auto dur = end - start; // auto ms = chrono::duration_cast(dur).count(); // cerr << "Time: " << ms << "ms" << endl; return 0; }