print((' YNeos'[int(eval(input()))in[a//10*(a%10)for a in range(100)]::2]))
print((' YNeos'[-int(eval(input()))in[a//~9*(a%10)for a in range(90)]::2]))
print((" YNeos"[int(eval(input())) in [a // 10 * (a % 10) for a in range(100)] :: 2]))

print((" YNeos"[-int(eval(input())) in [a // ~9 * (a % 10) for a in range(90)] :: 2]))

-print((" YNeos"[int(eval(input())) in [a // 10 * (a % 10) for a in range(100)] :: 2])) +print((" YNeos"[-int(eval(input())) in [a // ~9 * (a % 10) for a in range(90)] :: 2]))