main :: IO()
main = do
  [a,b] <- map read . words <$> getLine
  putStrLn $ show $ judge $ calc a b

judge :: Maybe Int -> Int
judge Nothing = -1
judge (Just n) = n

calc :: Int -> Int -> Maybe Int
calc a b
  | (a `div` 10) > 0 || (b `div` 10) > 0 = Nothing
  | otherwise = Just (a * b)
