n,m = map(int,input().split()) ok=1 for i in range(9): if n>>i == m>>i: continue else: ok=0 if ok: print('Yes') else: print('No')