n,m=map(int,input().split())
a=[]
for i in range(m):
    a.append(int(input()))

inf=1000000007

def fib(k):
    a, b = 1, 1
    for i in range(k):
        yield a
        a, b = b, a + b
 
l=[i for i in fib(n)]
p=[]
for i in range(n):
    if i+1 in a:
        p.append(1)
    else:
        p.append(0)

ans=1

for i in range(n-1):
   if p[i]==1 and p[i+1]==1:
       print(0)
       exit()
k=[a[0]-1]
for i in range(m-1):
    k.append(a[i+1]-a[i]-2)
k.append(n-a[m-1]-1)
print(k)
#if k[0]==0:
#   k[0]=1
for j in range(len(k)):
    if j==0:
        ans*=l[k[j]]%inf
    elif j==len(k)-1:
        ans*=l[k[j]]%inf
    else:
        ans*=l[k[j]]%inf
print(ans%inf)
