#include <iostream>

using namespace std;

#define MOD 1000000007
#define ll long long
#define pb push_back
#define st first
#define N 200005
#define nd second
#define ii pair<int,int>
#define fr freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

ll pw(ll b,ll e){
	if(!e) return 1;
	ll t=pw(b,e/2);
	t=t*t%MOD;
	if(e&1)
		return t*b%MOD;
	else return t;
}

ll fac[2000000];

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	//fr
	int x,y;
	cin>>x>>y;
	int n=(2*x-y)/3;
	int m=(2*y-x)/3;
	if(2*x<y || 2*y<x || (x+y)%3)return cout<<0,0;

	fac[0]=1;
	for(int i=1;i<=n+m;i++)
		fac[i]=(i*fac[i-1])%MOD;
	cout<<(fac[n+m]*pw(fac[n],MOD-2)%MOD)*pw(fac[m],MOD-2)%MOD;
}

### Prompt

Your task is to create 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>

using namespace std;

#define MOD 1000000007
#define ll long long
#define pb push_back
#define st first
#define N 200005
#define nd second
#define ii pair<int,int>
#define fr freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

ll pw(ll b,ll e){
	if(!e) return 1;
	ll t=pw(b,e/2);
	t=t*t%MOD;
	if(e&1)
		return t*b%MOD;
	else return t;
}

ll fac[2000000];

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	//fr
	int x,y;
	cin>>x>>y;
	int n=(2*x-y)/3;
	int m=(2*y-x)/3;
	if(2*x<y || 2*y<x || (x+y)%3)return cout<<0,0;

	fac[0]=1;
	for(int i=1;i<=n+m;i++)
		fac[i]=(i*fac[i-1])%MOD;
	cout<<(fac[n+m]*pw(fac[n],MOD-2)%MOD)*pw(fac[m],MOD-2)%MOD;
}

```