
N_list = []

for i in range(1,10):
    for j in range(1,10):
        N_list.append(i*j)
A_B = list(map(int, input().split()))
s = A_B[0]*A_B[1]
if A_B[0] < 10 & A_B[1] < 10:    
    if s in N_list:
        print(s)
    else :
        print("-1")
else :
    print("-1")
