## 24 hour archive: Problem

###
** 3288
- Pascal's Triangle: Sum of Levels** ** 3288 - Pascal's Triangle: Sum of Levels** ** 3288 - Pascal's Triangle: Sum of Levels**

#### Description

From Wikipedia, the free encyclopedia : "In mathematics, Pascal's triangle is a triangular array of the binomial coefficients. In much of the Western world it is named after French mathematician Blaise Pascal, although other mathematicians studied it centuries before him in India, Iran, China, Germany, and Italy".

Pascal's triangle is a triangle of integers, infinite and symmetrical, begins with a 1 in the first row (zero level triangle), and in the following rows are placed numbers in such way that each one is the sum of the two numbers it has above. It is assumed that the places outside the triangle contain zero, so that the edges of the triangle are formed by ones.

The following image contains the first levels of Pascal's triangle (from level 0 to level 6):

1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

1 6 15 20 15 6 1

... ... ...

In this problem you must compute the sum of all of Pascal's triangle's elements from level

Pascal's triangle is a triangle of integers, infinite and symmetrical, begins with a 1 in the first row (zero level triangle), and in the following rows are placed numbers in such way that each one is the sum of the two numbers it has above. It is assumed that the places outside the triangle contain zero, so that the edges of the triangle are formed by ones.

The following image contains the first levels of Pascal's triangle (from level 0 to level 6):

1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

1 6 15 20 15 6 1

... ... ...

In this problem you must compute the sum of all of Pascal's triangle's elements from level

**m**to level**n**.Pascal's triangle is a triangle of integers, infinite and symmetrical, begins with a 1 in the first row (zero level triangle), and in the following rows are placed numbers in such way that each one is the sum of the two numbers it has above. It is assumed that the places outside the triangle contain zero, so that the edges of the triangle are formed by ones.

The following image contains the first levels of Pascal's triangle (from level 0 to level 6):

1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

1 6 15 20 15 6 1

... ... ...

In this problem you must compute the sum of all of Pascal's triangle's elements from level

**m**to level

**n**.

Pascal's triangle is a triangle of integers, infinite and symmetrical, begins with a 1 in the first row (zero level triangle), and in the following rows are placed numbers in such way that each one is the sum of the two numbers it has above. It is assumed that the places outside the triangle contain zero, so that the edges of the triangle are formed by ones.

The following image contains the first levels of Pascal's triangle (from level 0 to level 6):

1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

1 6 15 20 15 6 1

... ... ...

In this problem you must compute the sum of all of Pascal's triangle's elements from level

**m**to level

**n**.

#### Input specification

The input may contain several test cases (but no more than 510000). Each test case is presented on a single line, and contains two positive integers

**m**and**n (0 <= m <= n <= 1000)**. The input ends with**m = - 1**and**n = -1**, and this case must not be processed.**m**and

**n (0 <= m <= n <= 1000)**. The input ends with

**m = - 1**and

**n = -1**, and this case must not be processed.

**m**and

**n (0 <= m <= n <= 1000)**. The input ends with

**m = - 1**and

**n = -1**, and this case must not be processed.

#### Output specification

For each test case, your program must print the sum of all Pascal's triangle's elements from level

**m**to level**n mod 1000007**. Each valid test case must generate just one output line.*mod operation means the remainder after division of one number by 1000007. Is denoted by the operator % in several programming languages.***m**to level

**n mod 1000007**. Each valid test case must generate just one output line.

*mod operation means the remainder after division of one number by 1000007. Is denoted by the operator % in several programming languages.*

**m**and

**n (0 <= m <= n <= 1000)**. The input ends with

**m = - 1**and

**n = -1**, and this case must not be processed.

#### Sample input

`0 0`

1 2

1 3

4 6

-1 -1

#### Sample output

`1`

6

14

112

#### Hint(s)

Use faster I/O methods

Use faster I/O methods

Use faster I/O methods