function Main(input) {
    var A = parseInt(input[0], 10);
    var B = parseInt(input[1], 10);

    console.log(A > 9 || B > 9 ? '-1' : A * B);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));