Bheith i ngra le
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Komorebi is a primary student who is learning how to draw a mountain.

First of all, he gets an grid, and he can paint some cells black and others white. Let's define a grid is good if:

  1. All the black cells are connected.

  2. For every column of the grid, if there are black cells, all the black cells must be connected and there must be one on the bottom.

Let's call the height of the highest black cell in the -th column . Specially, if there isn't any black cell in the -th column, then . To make the good graph more likely to be a mountain, the graph should satisfy that there at least exists a pair of integers :

  1. All the () are non-decreasing.

  2. All the () are non-increasing.

  3. All the () are equal.

Komorebi wants to know how many kinds of mountain graphs he can draw by his grid. Can you help him?

输入描述:

One line contains two integers  and (), the number of columns and rows of the grid.

输出描述:

One line contains one integer indicates the number of mountain graphs Komorebi can draw.
Answer should mod 10^9+7.
示例1

输入

复制
1 1

输出

复制
2
示例2

输入

复制
2 2

输出

复制
9
示例3

输入

复制
2 3

输出

复制
16