import qualified Data.ByteString.Char8 as BS
import qualified Data.Maybe as Maybe

solve :: Int -> Int -> Int
solve a b =
    if (a <= 9 && b <= 9)
        then a * b
        else -1

main = do
    [a, b] <- map (fst . Maybe.fromJust . BS.readInt) . BS.words <$> BS.getLine
    let ans = solve a b
    print ans