a;main(b){scanf("%d%d",&a,&b);printf("%d",a&~b?0:(1LL<<__builtin_popcount(~a&b)>>1)^!(a^b));}