A,B = map(int,input().split()) MOD = 10**9+7 flg = pow(A,B,MOD) == pow(B,A,MOD) if flg: print('Yes') else: print('No')