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.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.InputMismatchException;

public class D {
	public static long mod = 1000000007;
	public static long[] dp;
	public static int h;
	public static int r, g;

	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub
		InputReader s = new InputReader(System.in);
		PrintWriter p = new PrintWriter(System.out);
		r = s.nextInt();
		g = s.nextInt();
		int total = r + g;
		h = 0;
		for (h = 1; h <= 100000; h++) {
			if (h * (h + 1) / 2 > total) {
				h--;
				break;
			}
		}
		dp = new long[r + 1];
		dp[0] = 1;
		for (int i = 1; i <= h; i++) {
			for (int red = Math.min(r, h * (h + 1) / 2); red >= i; red--) {
				dp[red] = (dp[red] + dp[red - i])%mod;
			}
		}
		long ans = 0;
		for(int i = Math.max(0, h*(h+1)/2-g); i <= Math.min(h*(h+1)/2, r); i++) {
			ans+=dp[i];
			ans%=mod;
		}
		System.out.println(ans);
		p.flush();
		p.close();
	}

	// how to store int dp
//	public static long getval(int i, int red) {
//		int used = (i) * (i - 1) / 2;
//		int usedred = r - red;
//		int usedgreen = used - usedred;
//		int green = g - usedgreen;
//		if (red < 0 || green < 0)
//			return 0;
//		if (i == h + 1) {
//			return 1;
//		}
//		long ans = dp[0][red];
//		if (red >= i && green >= i) {
//			ans *= 2;
//		}
//		return ans;
//	}

	static class pair implements Comparable<pair> {
		Long x, y;

		pair(long x, long y) {
			this.x = x;
			this.y = y;
		}

		public int compareTo(pair o) {
			int result = x.compareTo(o.x);
			if (result == 0)
				result = y.compareTo(o.y);

			return result;
		}

		public String toString() {
			return x + " " + y;
		}

		public boolean equals(Object o) {
			if (o instanceof pair) {
				pair p = (pair) o;
				return p.x - x == 0 && p.y - y == 0;
			}
			return false;
		}

		public int hashCode() {
			return new Long(x).hashCode() * 31 + new Long(y).hashCode();
		}
	}

	static long gcd(long a, long b) {
		if (b == 0)
			return a;
		return gcd(b, a % b);
	}

	public static ArrayList<Long> Divisors(long n) {
		ArrayList<Long> div = new ArrayList<>();

		for (long i = 1; i <= Math.sqrt(n); i++) {
			if (n % i == 0) {
				div.add(i);
				if (n / i != i)
					div.add(n / i);
			}
		}
		return div;
	}

	public static int BinarySearch(long[] a, long k) {
		int n = a.length;
		int i = 0, j = n - 1;
		int mid = 0;

		if (k < a[0])
			return 0;
		else if (k >= a[n - 1])
			return n;
		else {
			while (j - i > 1) {
				mid = (i + j) / 2;

				if (k >= a[mid])
					i = mid;
				else
					j = mid;
			}
		}

		return i + 1;
	}

	public static long GCD(long a, long b) {
		if (b == 0)
			return a;
		else
			return GCD(b, a % b);
	}

	public static long LCM(long a, long b) {
		return (a * b) / GCD(a, b);
	}

//	static class pair implements Comparable<pair> {
//		Integer x, y;
//
//		pair(int x, int y) {
//			this.x = x;
//			this.y = y;
//		}
//
//		public int compareTo(pair o) {
//			int result = x.compareTo(o.x);
//			if (result == 0)
//				result = y.compareTo(o.y);
//
//			return result;
//		}
//
//		public String toString() {
//			return x + " " + y;
//		}
//
//		public boolean equals(Object o) {
//			if (o instanceof pair) {
//				pair p = (pair) o;
//				return p.x - x == 0 && p.y - y == 0;
//			}
//			return false;
//		}
//
//		public int hashCode() {
//			return new Long(x).hashCode() * 31 + new Long(y).hashCode();
//		}
//	}

	static class InputReader {

		private final InputStream stream;
		private final byte[] buf = new byte[8192];
		private int curChar, snumChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c)) {
				c = snext();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = snext();
			while (isSpaceChar(c)) {
				c = snext();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		public String readString() {
			int c = snext();
			while (isSpaceChar(c)) {
				c = snext();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public String nextLine() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}

	static class CodeX {
		public static void sort(long arr[]) {
			merge_sort(arr, 0, arr.length - 1);
		}

		private static void merge_sort(long A[], long start, long end) {
			if (start < end) {
				long mid = (start + end) / 2;
				merge_sort(A, start, mid);
				merge_sort(A, mid + 1, end);
				merge(A, start, mid, end);
			}

		}

		private static void merge(long A[], long start, long mid, long end) {
			long p = start, q = mid + 1;
			long Arr[] = new long[(int) (end - start + 1)];
			long k = 0;

			for (int i = (int) start; i <= end; i++) {
				if (p > mid)
					Arr[(int) k++] = A[(int) q++];

				else if (q > end)
					Arr[(int) k++] = A[(int) p++];

				else if (A[(int) p] < A[(int) q])
					Arr[(int) k++] = A[(int) p++];

				else
					Arr[(int) k++] = A[(int) q++];
			}
			for (int i = 0; i < k; i++) {
				A[(int) start++] = Arr[i];
			}

		}

	}

}