/*input
999999 999999
*/
#include<bits/stdc++.h>
#define int long long
#define MOD 1000000007
using namespace std;

int fact(int n){
	int ans = 1;
	for(int i=1;i<=n;i++){
		ans *= i;	ans %= MOD;
	}
	return ans;
}

int power(int a,int b,int c = MOD){
	if(b==0)	return 1;
	int x = power(a,b/2,c);
	x=(x*x)%c;
	if(b%2==0)
		return x;
	return (a*x)%c;
}

signed main(){
	int x,y;
	cin >> x >> y;
	int a = 2*y-x,b = 2*x-y;

	if(a<0 || b<0 || a%3 !=0 || b%3 !=0){
		cout << "0\n";	return 0;
	}
	a/=3LL; b/=3LL;

	int ans = fact(a+b)*power(fact(a),MOD-2);	ans %= MOD;
		ans *= power(fact(b),MOD-2);	ans %= MOD;
	cout << ans;
}

### 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
/*input
999999 999999
*/
#include<bits/stdc++.h>
#define int long long
#define MOD 1000000007
using namespace std;

int fact(int n){
	int ans = 1;
	for(int i=1;i<=n;i++){
		ans *= i;	ans %= MOD;
	}
	return ans;
}

int power(int a,int b,int c = MOD){
	if(b==0)	return 1;
	int x = power(a,b/2,c);
	x=(x*x)%c;
	if(b%2==0)
		return x;
	return (a*x)%c;
}

signed main(){
	int x,y;
	cin >> x >> y;
	int a = 2*y-x,b = 2*x-y;

	if(a<0 || b<0 || a%3 !=0 || b%3 !=0){
		cout << "0\n";	return 0;
	}
	a/=3LL; b/=3LL;

	int ans = fact(a+b)*power(fact(a),MOD-2);	ans %= MOD;
		ans *= power(fact(b),MOD-2);	ans %= MOD;
	cout << ans;
}

```