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

fiblist=[1,1]
for j in range(10**5):
    nums=(fiblist[-1]+fiblist[-2])%(10**9+7)
    fiblist.append(nums)
lists.insert(0,0)
lists.append(n)
ans=1
for i in range(m+1):
    if i==0:
        ans=ans*fiblist[lists[1]-lists[0]-1]
        ans=ans%(10**9+7)
    elif i==m:
        ans=ans*fiblist[lists[m+1]-lists[m]-1]
        ans=ans%(10**9+7)
    elif i!=0 and i!=m:
        if lists[i+1]-lists[i]==1:
            ans=0
            break
        else:
            ans=ans*fiblist[lists[i+1]-lists[i]-2]
            ans=ans%(10**9+7)
print(ans) 