#include <bits/stdc++.h>
#define ll long long
#define rep(i,l,r) for(int (i)=(l);(i)<(r);(i)++)
#define erep(i,l,r) for(int (i)=(l);(i)<=(r);(i)++)
#define MOD 1000000007
using namespace std;
#define ll long long
ll inv(ll a){
  ll t=1;
  while (a>1){
    t=t*(MOD-MOD/a)%MOD;
    a=MOD%a;
  }
  return t;
}
ll comb(ll n,ll k){
  if (k>n-k) k=n-k;
  ll nu=1,de=1;
  rep(i,1,k+1){
    nu=nu*(n+1-i)%MOD;
    de=de*i%MOD;
  }
  return nu*inv(de)%MOD;
}
int main(){
    ll x,y,i=-1,j=-1;
    cin>>x>>y;
    if((2*x-y)%3==0)i=(2*x-y)/3;
    if((2*y-x)%3==0)j=(2*y-x)/3;
    if(i<0||j<0)cout<< "0" <<endl;
    else cout<< comb(i+j,j) <<endl;
}
### Prompt

Create a solution in cpp for 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 <bits/stdc++.h>
#define ll long long
#define rep(i,l,r) for(int (i)=(l);(i)<(r);(i)++)
#define erep(i,l,r) for(int (i)=(l);(i)<=(r);(i)++)
#define MOD 1000000007
using namespace std;
#define ll long long
ll inv(ll a){
  ll t=1;
  while (a>1){
    t=t*(MOD-MOD/a)%MOD;
    a=MOD%a;
  }
  return t;
}
ll comb(ll n,ll k){
  if (k>n-k) k=n-k;
  ll nu=1,de=1;
  rep(i,1,k+1){
    nu=nu*(n+1-i)%MOD;
    de=de*i%MOD;
  }
  return nu*inv(de)%MOD;
}
int main(){
    ll x,y,i=-1,j=-1;
    cin>>x>>y;
    if((2*x-y)%3==0)i=(2*x-y)/3;
    if((2*y-x)%3==0)j=(2*y-x)/3;
    if(i<0||j<0)cout<< "0" <<endl;
    else cout<< comb(i+j,j) <<endl;
}
```