#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
    int a,b;
    cin>>a>>b;
    if(a*b%10==0){
        cout>>-1>>endl;
    }
    else{
        cout<<a*b<<endl;
    }
}