n,m=map(str,input().split())
if(len(n)==len(m)==1):
	print(int(n)*int(m))
elif(len(m)>1):
	print(-1)
else:
	n=n[::-1]
	ans=""
	a=0
	for i in range(len(n)-1):
		if(int(n[i])*int(m)>9):
			# ans=-1
			a=-1
			break
		else:
			ans=str(int(n[i])*int(m)) + ans
	ans=str(int(n[-1])*int(m))+ans
	if(a==-1):
		print(-1)
	else:
		print(ans)

