#include<iostream>
#define N 1000000007
typedef long long ll;
using namespace std;
ll quick_mod(ll a,ll b){
    ll ans=1;  
    a%=N;
    while (b){  
        if (b&1){ 
            ans=ans*a%N;  
    		b--;
		}
        b>>=1;
        a=a*a%N;
    }
	return ans;  
}

ll C(ll n,ll m){
	if (m>n) return 0;  
	ll ans=1;  
	for (int i=1;i<=m;i++){ 
		ll a=(n+i-m)%N;
		ll b=i%N;
		ans=ans*(a*quick_mod(b,N-2)%N)%N;
	}
	return ans;
}

int main(){
	ll n,a,b,x,y;
	cin>>x>>y;
	n=(x+y)/3;
	if (3*n!=(x+y)){
		cout<<"0";
		return 0;
	}
	a=(2*x-y)/3;
	b=(2*y-x)/3;
	if (a<0||b<0){
		cout<<"0";
		return 0;	
	}
	cout<<C(n,a);
	return 0;
}
### Prompt

Your challenge is to write a CPP solution to the following problem:

There is a knight - the chess piece - at the origin (0, 0) of a two-dimensional grid.

When the knight is at the square (i, j), it can be moved to either (i+1,j+2) or (i+2, j+1).

In how many ways can the knight reach the square (X, Y)?

Find the number of ways modulo 10^9 + 7.

Constraints

* 1 \leq X \leq 10^6
* 1 \leq Y \leq 10^6
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


X Y


Output

Print the number of ways for the knight to reach (X, Y) from (0, 0), modulo 10^9 + 7.

Examples

Input

3 3


Output

2


Input

2 2


Output

0


Input

999999 999999


Output

151840682

### Response

```cpp
#include<iostream>
#define N 1000000007
typedef long long ll;
using namespace std;
ll quick_mod(ll a,ll b){
    ll ans=1;  
    a%=N;
    while (b){  
        if (b&1){ 
            ans=ans*a%N;  
    		b--;
		}
        b>>=1;
        a=a*a%N;
    }
	return ans;  
}

ll C(ll n,ll m){
	if (m>n) return 0;  
	ll ans=1;  
	for (int i=1;i<=m;i++){ 
		ll a=(n+i-m)%N;
		ll b=i%N;
		ans=ans*(a*quick_mod(b,N-2)%N)%N;
	}
	return ans;
}

int main(){
	ll n,a,b,x,y;
	cin>>x>>y;
	n=(x+y)/3;
	if (3*n!=(x+y)){
		cout<<"0";
		return 0;
	}
	a=(2*x-y)/3;
	b=(2*y-x)/3;
	if (a<0||b<0){
		cout<<"0";
		return 0;	
	}
	cout<<C(n,a);
	return 0;
}
```