import numpy as np


N, M = list(map(int, input().split()))

a = []
for i in range(M):
    b = int(input())
    a.append(b)

sq = []
for k in range(M+1):
    if k == 0:
        sq.append(a[k])
    
    elif k == M:
        sq.append(N-a[k-1])

    elif a[k] == a[k-1] +1:
        sq.append(0)
    
    else:
        sq.append(a[k] - a[k-1]-1)

ans = 1
for p in sq:
    if p == 0:
        ans *= 0
    else:
        q = int((1/np.sqrt(5))*  ( (((1+np.sqrt(5))/2)**p) -  (((1-np.sqrt(5))/2)**p)  ))%1000000007
        ans *= q
        


print(int(ans)%(1000000007))