A,B = map(int,input().split())

list_aaa = [1,2,3,4,5,6,7,8,9]

ans = 0

for i in list_aaa:
    if A == i or B == i:
        ans = 1
    else:
        ans = 2

if ans ==1:
    print(A*B)
else:
    print('-1')