a;main(b){scanf("%d%d",&a,&b);printf("%d",(1LL<<__builtin_popcount(~a&b))*!(a&~b)/2+!(a^b));}