N = input().strip() M = input().strip() if M == 10 * N or N == 10 * M: print("Yes") else: print("No")