main(N,M){scanf("%d%d",&N,&M);puts(M>N%2+1?"1":"-1");}