using System;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            string A = Console.ReadLine();
            string B = Console.ReadLine();

            int a = int.Parse(A); int b = int.Parse(B);
            int an;
            if(a<=9&&b<=9){
                an = a * b;
            }
            else{
                an = -1;
            }
            Console.Write(an);
        }
    }
}