toInt :: (String -> Int)
toInt x = read x ::Int

getInts = do
	x <- getLine
    let y = (map$toInt)$words x
    return y

main :: IO ()
main = do
    x y <- getInts -- < 1 2 3 4 5 6
	if x > 9 then print -1 else if y > 9 then print -1 else print (x*y)