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
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int y = sc.nextInt();
		int t3 = x * 2 - y;
		int s3 = y * 2 - x;
		sc.close();
		if(t3 < 0 || t3 % 3 != 0 || s3 < 0 || s3 % 3 != 0) {
			System.out.println(0);
			return;
		}
		int t = t3 / 3;
		int s = s3 / 3;
		int mod = 1000000007;

		System.out.println(nCk(t + s, s , mod));

	}
	public static int nCk(int n,int k,int M) {
        long ret = 1;
        int min = Math.min(k, n-k);
        for(int i=1;i<=min;i++) {
            ret = (ret * pow(i,M-2,M)) % M;
        }
        for(int i=n-min+1;i<=n;i++) {
            ret = (ret * i) % M;
        }
        return (int)ret;
    }
	 public static long pow(long a,long b,int M) {
	        long ret = 1;
	        long tmp = a;
	        while(b>0) {
	            if((b&1)==1) ret = (ret * tmp) % M;  //2進数によるべき乗の高速計算
	            tmp = (tmp * tmp) % M;
	            b = b>>1;
	        }
	        return ret;
	    }
}

