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