a, b = map(int, input().split())
bool1=False
#print(a,"to",b) a=21 b=1 i=3 j=7 out
if 1<=a and a<=20 and 1<=b and b<=20:
	for i+1 in range(10):
		for j+1 in range(10):
			#print(i)
			if i*j == a*b:
				#print("a")
				bool1=True
				#print(bool1)
				break
			else:
				#print("j={0}".format(j))
				pass
		if bool1==True:
			break
#print(bool1)
if bool1==True:
	print(a*b)
else:
	print(-1)
