#include <stdio.h>
using namespace std;
int main () {
    int a,b,job=0;
    cin << a << b;
    if ((a<1 || a>20) ||  (b<1 || b>20)) {
        cout << -1;
    } else {
        for (int i=1;i<=9;i++) {
            for (int j=1;j<=9;j++) {
                if (a*b==i*j) {job=1;break;}
            }
        }
        if (job==1) cout << a*b;
        else cout << -1;
    }
    return 0;
}
