import numpy as np
import itertools

z = input().split()
z = [ int(x) for x in z]
broken = []
for i in range(z[1]):
    broken.append(input())
#print(broken)

max_step = z[0] 
def steps(cand):
#  tmp = np.zeros_like(cand)
  tmp = []
  for j in range(len(cand)):
    tmp.append(sum(cand[:j+1]))
  return tmp

count = 0
all_count = 0
A = [1 , 2 ]

for i in range(int(max_step/2), max_step+1):
    #iは段の数
    
    for v in itertools.product(A, repeat = i):
      if sum(v) == max_step:
        all_count += 1
        for b in broken:
          if list(steps(v)).count(int(b)) > 0:
            count += 1
            break
        

print((all_count - count)%1000000007)