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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author MiroO
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        private static final int MODULO = 1000000007;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int S = in.readInt();
            int T = in.readInt();

            int nsum = 0;
            int n = 0;
            for (int i = 1; i < 2300; i++) {
                nsum = nsum + i;
                if (nsum > S + T) {
                    n = i - 1;
                    break;
                }
            }


            // pocet moznosti po dany den s vyuzitim S-testov
            int[] dpCurrent = new int[S + 1];
            // pocty moznosti pre predchadzajuci den
            int[] dpPrevious = null;
            // 1 moznost pre 0. den s pouzitim 0 S-testov
            dpCurrent[0] = 1;
            // sucet pouzitych testov
            int sum = 0;
            for (int day = 1; day <= n; day++) {
                dpPrevious = dpCurrent;
                dpCurrent = new int[S + 1];

                sum += day;
                for (int r = Math.max(0, sum - T); r <= S; ++r) {
                    // pocet moznosti za pouzitia T-testu
                    dpCurrent[r] = dpPrevious[r];
                    if (r - day >= 0) {
                        // plus pocet moznosti za pouzitia S-testov
                        dpCurrent[r] = (dpCurrent[r] + dpPrevious[r - day]) % MODULO;
                    }
                }
          /* System.out.println("---");
            System.out.println(Arrays.toString(dpPrevious));
            System.out.println(Arrays.toString(dpCurrent));*/
            }
            // najdenie riesenia - sucet moznosti po poslednom dni
            int result = 0;
            for (int i = 0; i < dpCurrent.length; i++) {
                result = (result + dpCurrent[i]) % MODULO;
            }
            out.println(result);
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void println(int i) {
            writer.println(i);
        }

        public void close() {
            writer.close();
        }

    }

    static class InputReader extends InputStream {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

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

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

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

        public static boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}