import sys
sys.setrecursionlimit(100000)
INF = 1000000007
n,m= map(int,input().split())
a = [0]*m
for i in range(m):
    a[i] = int(input())

step = [0]*100000
step[0] =1
step[1] =1
step[2] =2
for i in range(3,100000):
    step[i] = step[i-1] + step[i-2]

l = [a[0]-1]
for i in range(1,m):
    l.append(a[i]-a[i-1]-2)
l.append(n-a[m-1]-1)

ans = 1

for i in range(m+1):
    if step[l[i]] < 0:
        ans = 0
        break
    ans = ans*step[l[i]]
    if ans >= INF:
        ans = ans % INF

print(ans)
    