#include<bits/stdc++.h>
using namespace std;
#define ll long long 
int main()
{
	ll a,b;
  	cin >> a >> b;
  	string s1=string(a);
  	string s2=string(b);
	ll pro=a*b;
  	int ck=1;
  	for(ll i=0;i<s1.length();i++)
    { 
      if(s1[i]=='0')
        ck=0;
    }
    for(ll i=0;i<s2.length();i++)
    {
      if(s2[i]=='0')
        ck=0;
    }
  	if(ck==0)
      cout << -1;
 	else
      cout << pro;
}