#P1999. Counting Faces in a Hypercube

    ID: 15281 Type: Default 1000ms 256MiB

Counting Faces in a Hypercube

Counting Faces in a Hypercube

In an aa-dimensional hypercube, the number of bb-dimensional faces is given by the formula [ F(a, b) = \binom{a}{b} \cdot 2^{a-b}, ] where (\binom{a}{b}) is the binomial coefficient. For example, a square (2-dimensional hypercube) has 4 vertices (0-dimensional faces), 4 edges (1-dimensional faces), and 1 square (2-dimensional face); a cube (3-dimensional hypercube) has 8 vertices, 12 edges, 6 faces, and 1 cube.

Given two integers aa and bb (with 0ba0 \le b \le a), compute the number of bb-dimensional faces contained in an aa-dimensional hypercube, modulo 109+710^9+7.

inputFormat

The input consists of a single line containing two space-separated integers aa and bb.

outputFormat

Output a single integer representing the number of bb-dimensional faces in an aa-dimensional hypercube modulo 109+710^9+7.

sample

3 1
12