{-# LANGUAGE OverloadedStrings #-}

import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.Attoparsec.ByteString.Char8

main :: IO ()
main = do
  contents <- B.getContents
  case parseOnly inputParser contents of
    Right r -> print $ solve r
    Left  e -> error e

inputParser = (,) <$> decimal <* space <*> decimal

solve :: (Int, Int) -> Int
solve (a, b)
  | a > 9 || b > 9 = -1
  | otherwise      = a * b