def kaidan(n):
    steps = [0] * (n+1)
 
    steps[1] = 1
    steps[2] = 2
    steps[3] = 3
    for i in range(4, n+1):
        steps[i] = steps[i-1] + steps[i-2] + steps[i-3]
 
    return steps[n]
  
 
a = input()
a = a.split(" ")
N = int(a[0])
M = int(a[1])
 
cns = []
 
d_list = []
for i in range(M):
    d_list.append(int((input())))
    
# print(d_list)
ddd = kaidan(N)
for i  in(d_list):
    an = kaidan(i)
    bn  = kaidan(N+1-i)
    cn = an* bn -2
    cns.append(cn)
    
answer = ddd - sum(cns)
print(answer%1000000007)