num = int(eval(input()))



for i in range(1, 10):

	for j in range(1, 10):

		if (i * j) / num == 1:

			print("Yes")

			exit()



print("No")
num = int(eval(input()))

i = 1



while i <= 9:

    j = 1

    while j <= 9:

        if (i * j) / num == 1:

            print("Yes")

            exit()

        else:

            j += 1

    i += 1





print("No")
num = int(eval(input()))
for i in range(1, 10):
    for j in range(1, 10):
        if (i * j) / num == 1:
            print("Yes")
            exit()
print("No")

num = int(eval(input()))
i = 1
while i <= 9:
    j = 1
    while j <= 9:
        if (i * j) / num == 1:
            print("Yes")
            exit()
        else:
            j += 1
    i += 1
print("No")

-for i in range(1, 10): -    for j in range(1, 10): +i = 1 +while i <= 9: +    j = 1 +    while j <= 9: +        else: +            j += 1 +    i += 1