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] 
import numpy as np

all_possible = []

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

template_steps = []
for i in range(int(max_step/2), max_step+1):
    template_steps = []
    #iは段の数
        
    import itertools
    
    #for v in itertools.permutations(template_steps):
      #  arrays.append(v)
    A = [1 , 2 ]
    for v in itertools.product(A, repeat = i):
      if sum(v) == max_step:
         all_possible.append(v)

#print(all_possible)    
count = 0
all_count = 0

for i in range(len(all_possible)):
  #print(i)
  all_possible[i] = steps(all_possible[i])
  #print(list(all_possible[i]).count(2))
  
  all_count += 1
    
  for b in broken:
    #print( list(all_possible[i]).count(int(b)))
    if  list(all_possible[i]).count(int(b)) > 0:
        all_possible[i]= [0,0]
        count += 1
        
print((all_count - count)%1000000007)