634_B. XOR Equation_8837
Two positive integers a and b have a sum of s and a bitwise XOR of x. How many possible values are there for the ordered pair (a, b)?

Input

The first line of the input contains two integers s and x (2 ≤ s ≤ 1012, 0 ≤ x ≤ 1012), the sum and bitwise xor of the pair of positive integers, respectively.

Output

Print a single integer, the number of solutions to the given conditions. If no solutions exist, print 0.

Examples

Input

9 5


Output

4


Input

3 3


Output

2


Input

5 2


Output

0

Note

In the first sample, we have the following solutions: (2, 7), (3, 6), (6, 3), (7, 2).

In the second sample, the only solutions are (1, 2) and (2, 1).
from collections import defaultdict

"""
[int(i) for i in raw_input().split(" ")]
raw_input()
raw_input().split(" ")


"""

def test(a,b,c):
	if (a,b,c) == (0,0,0):
		return (1,1)
	if (a,b,c) == (1,0,0):
		return (0,0)
	if (a,b,c) == (0,1,0):
		return (0,0)
	if (a,b,c) == (1,1,0):
		return (1,1)
		
	if (a,b,c) == (0,0,1):
		return (0,0)
	if (a,b,c) == (1,0,1):
		return (0,2)
	if (a,b,c) == (0,1,1):
		return (2,0)
	if (a,b,c) == (1,1,1):
		return (0,0)

def safe(L,t):
	if t >= len(L):
		return 0
	return L[t]
			
			

def main():
	a,b = [int(i) for i in raw_input().split(" ")]
	
	abin = "{0:b}".format(a)
	bbin = "{0:b}".format(b)
		
	abin = abin[::-1]
	bbin = bbin[::-1]
	#print abin
	#print bbin
	
	oe = 0
	no = 1
	upto = max(len(abin),len(bbin))
	for t in range(upto):
		v1,v2 = test(1,int(safe(abin,t)),int(safe(bbin,t)))
		w1,w2 = test(0,int(safe(abin,t)),int(safe(bbin,t)))
		
		
		if t != upto-1:
			no,oe = v1*oe + w1*no , v2*oe + w2*no
		else:
			no = v1*oe + w1*no
		
		#print t,no,oe
	

	if a != b:
		print no
	else:
		print no-2
		
main()
	
	