H,W=map(int,input().split()) if H%2==1 or W%2==1: print(-1) else: exit(1)