def dot(A, B): C = [[None for col in range(2)] for row in range(2)] for row in range(2): for col in range(2): # C[row][col]:= Aのrow行目とBのcol列目の内積 tmp = 0 for i in range(2): tmp += A[row][i] * B[i][col] C[row][col] = tmp return C A = [list(map(int, input().split())) for row in range(2)] B = [list(map(int, input().split())) for row in range(2)] for a in range(67): for b in range(67): for c in range(67): for d in range(67): P = [[a, b], [c, d]] PA = dot(P, A) BP = dot(B, P) if (PA[0][0]%67 == BP[0][0]%67) and (PA[0][1]%67 == BP[0][1]%67) and (PA[1][0]%67 == BP[1][0]%67) and (PA[1][1]%67 == BP[1][1]%67): if (a*d - b*c) % 67 != 0: print("Yes") exit() print("No")