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