This page is still under construction.

Parts of this page are still being built. What you see may change.

Array Initialization

Time limit2sMemory limit512 MB

Summary
Count ordered sequences of M interval marks on an array of length N whose union covers every position, modulo 1e9+7.
Level

Medium7 of 10

Topics
Dynamic programming, Combinatorics, Intervals, Math
Solved
No attempts yet

Problem

Many programming languages have functions that fill an entire array, or part of it, with a given value. In Pascal this is fillchar(), in Java it is Arrays.fill(), and in C++ it is memset(). The new programming language J# has a function mark() that works only with boolean arrays.

Called with two parameters aa and bb, mark assigns true to every element of the array with index from aa to bb inclusive. For example, take an array of length 4 whose elements are numbered from one and whose values are all initially false. Running mark(1, 3) and then mark(2, 4) on it fills the whole array with true.

One of the first assignments for people starting to learn J# is to write a program that contains exactly MM mark operations and completely fills an array of length NN, initially filled with false, with true.

You solved this assignment quickly, and now you wonder: in how many different ways can this be done? Two programs are considered different if the ii-th mark operation is run with different parameters in them for at least one ii from 1 to MM. This number can be large, so you need to compute it modulo 109+710^9+7.

Input

The first line of the input file contains two positive integers NN and MM: the length of the array and the number of mark operations the program must contain. (1≤N,M≤701 \le N, M \le 70)

Output

In a single line of the output file, print the remainder modulo 109+710^9+7 of the number of ways to fill an array of NN elements with true using MM calls of the mark operation.

Hint

The required variants:

  • mark(1, 1); mark(1, 2)
  • mark(1, 1); mark(2, 2)
  • mark(1, 2); mark(1, 1)
  • mark(1, 2); mark(1, 2)
  • mark(1, 2); mark(2, 2)
  • mark(2, 2); mark(1, 1)
  • mark(2, 2); mark(1, 2)

Examples1

  1. Example 1

    Input
    2 2
    
    Expected output
    7