CSES - Datatähti Open 2019 - Binary tree
  • Time limit: 1.00 s
  • Memory limit: 512 MB

A binary tree has nn levels and the tree is perfect, i.e., each node has two children (except for the leaves). The nodes of the tree are numbered so that the root is 11 and the left and right children of a node kk are 2k2k and 2k+12k+1. In addition, the tree has mm forbidden edges that we may not traverse.

We construct a graph based on the tree by mirroring it in the leaves. How many paths are there such that the path starts and ends in the root of the original tree, it contains at least one edge and does not traverse any edge more than once?

For example, the following graph has 1212 such paths:

Input

The first input line has two integers nn and mm: the height of the tree and the number of forbidden edges.

After this, there are mm lines that contain integers a1,a2,,ama_1, a_2, \dots, a_m. An integer aia_i indicates that we may not use the edge between the nodes aia_i and ai2\left \lfloor{\frac{a_i}{2}}\right \rfloor. Each such edge is given only once.

Output

Print one integer: the number of distinct paths modulo 109+710^9+7.

Example

Input:

4 3
10
5
13

Output:

12

The image corresponds to the example. The forbidden edges are red.

Subtask 1 (23 points)

  • 2n62 \leq n \leq 6

Subtask 2 (26 points)

  • 2n602 \leq n \leq 60
  • m=0m = 0

Subtask 3 (51 points)

  • 2n602 \leq n \leq 60
  • 0m1050 \leq m \leq 10^5