Problem: There are r red and g green blocks for construction of the red-green tower. Red-green tower can be built following next rules:

  * Red-green tower is consisting of some number of levels;

  * Let the red-green tower consist of n levels, then the first level of this tower should consist of n blocks, second level — of n - 1 blocks, the third one — of n - 2 blocks, and so on — the last level of such tower should consist of the one block. In other words, each successive level should contain one block less than the previous one;

  * Each level of the red-green tower should contain blocks of the same color.

<image>

Let h be the maximum possible number of levels of red-green tower, that can be built out of r red and g green blocks meeting the rules above. The task is to determine how many different red-green towers having h levels can be built out of the available blocks.

Two red-green towers are considered different if there exists some level, that consists of red blocks in the one tower and consists of green blocks in the other tower.

You are to write a program that will find the number of different red-green towers of height h modulo 109 + 7.

Input

The only line of input contains two integers r and g, separated by a single space — the number of available red and green blocks respectively (0 ≤ r, g ≤ 2·105, r + g ≥ 1).

Output

Output the only integer — the number of different possible red-green towers of height h modulo 109 + 7.

Examples

Input

4 6


Output

2


Input

9 7


Output

6


Input

1 1


Output

2

Note

The image in the problem statement shows all possible red-green towers for the first sample.

Solution (in JAVA):

Solution:
import java.util.*;
import java.math.*;
import java.io.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;

public class Main{
	
	// ArrayList<Integer> lis = new ArrayList<Integer>();
	// ArrayList<String> lis = new ArrayList<String>();
	//  PriorityQueue<P> que = new PriorityQueue<P>();
	// PriorityQueue<Integer> que = new PriorityQueue<Integer>();
	//  Stack<Integer> que = new Stack<Integer>();
	//HashMap<Long,Long> map = new HashMap<Long,Long>();
    //	static long sum=0;
	// 1000000007 (10^9+7)
	static int mod = 1000000007;
	//static int mod = 1000000009,r=0; ArrayList<Integer> l[]= new ArrayList[n];
   // static int dx[]={1,-1,0,0};
//	static int dy[]={0,0,1,-1};
//	static int dx[]={1,-1,0,0,1,1,-1,-1};
//  static int dy[]={0,0,1,-1,1,-1,1,-1};
	//static Set<Integer> set = new HashSet<Integer>();

	//static ArrayList<Integer> l[];
    //static int parent[][],depth[],node,max_log;


			  
public  static void main(String[] args)   throws Exception, IOException{
   //String line=""; throws Exception, IOException
   //(line=br.readLine())!=null
	//Scanner sc =new Scanner(System.in);
	// !!caution!! int long //  
	Reader sc = new Reader(System.in);
   

    //,a=sc.nextInt(),b=sc.nextInt();
 	// int n=sc.nextInt(),p[]=new int[n],q[]=new int[n];
	//int n=sc.nextInt(),a[]=new int[n],b[]=new int[n];
	//int n=sc.nextInt(); //,k=sc.nextInt();
	//long n=sc.nextLong(),k=0,r=0;
	

	
	//int n=sc.nextInt(), e[][]=new int[n][n]; 

	int r=sc.nextInt(), g=sc.nextInt();
	int h=(int)sqrt( 2*(r+g) ), m=min(r,g);
	
	if( (long)h*(h+1)/2>r+g )h--;
 
	
	long d[][]=new long[2][m+1];
    long a=0;

   // d[1][1]++;     
    d[0][0]=d[1][0]=1;     
  
    
	for (int i = 1; i <= h ; i++) {
	
		int c=i%2,cc=(c+1)%2;
		long x=(long)i*(i+1);
		
     for (int j = 1; j<=m && x>=j ; j++) {
    	 if( j<i ){  d[c][j]=d[cc][j]; continue;}
    	   d[c][j]=d[cc][j]+d[cc][j-i];
    	   d[c][j]%=mod;
	    }
    // db(i,d);
     
	}
	
	long df=-(long)h*(h+1)/2+r+g;
	//  db(h);
	
	for (int i = 0; i <= df && m-i>=0 ; i++){
		a+=d[h%2][m-i];
		a%=mod;
	}
	
	System.out.println( a );
   
}






/*
  static class P implements Comparable<P>{
	int id, d; ;
	P(int id,int d){
		this.id=id;
		this.d=d;
	} 
	
	public int compareTo(P x){
	//	return  (-x.d+d)>=0?1:-1  ; // ascend long
		return   -x.d+d  ; // ascend
	//	 return   x.d-d  ; //descend
	   }
 
}
*/



  

static void db(Object... os){
    System.err.println(Arrays.deepToString(os));

}


}




class QuickUnionWeighted {
    public int[] id;
    private int[] sz;
    public QuickUnionWeighted(int N)
    {
        id = new int[N];
        sz = new int[N];
        for (int i = 0; i < N; i++) {
            id[i] = i;
            sz[i] = 1;
        }
    }
    
    private int root(int p) {
        while (id[p] != p) p = id[p];
        return p;
    }
    
    public boolean connected(int id1, int id2) {
        return root(id1) == root(id2);
    }
    
    public void union(int p, int q) {
        int i = root(p);
        int j = root(q);
        if( i==j )return;
        if (sz[i] < sz[j]) { id[i] = j; sz[j] += sz[i];   }
        else               { id[j] = i; sz[i] += sz[j];   }  
    }
    public int sz(int x){
   	 return sz[ root(x) ];
    }
 }

class Reader
{ 
	private BufferedReader x;
	private StringTokenizer st;
	
	public Reader(InputStream in)
	{
		x = new BufferedReader(new InputStreamReader(in));
		st = null;
	}
	public String nextString() throws IOException
	{
		while( st==null || !st.hasMoreTokens() )
			st = new StringTokenizer(x.readLine());
		return st.nextToken();
	}
	public int nextInt() throws IOException
	{
		return Integer.parseInt(nextString());
	}
	public long nextLong() throws IOException
	{
		return Long.parseLong(nextString());
	}
	public double nextDouble() throws IOException
	{
		return Double.parseDouble(nextString());
	}
}