n,m = map(int,input().split())
c=10**9+7
a = [-1 for _ in range(m + 1)]
for i in range(1, m+1):
    a = a + [int(input())]
a =a+[n+1] 
for i in range(m+1):
    a[i]=a[i+1] - a[i]-1
b=[0 for _ in range(max(a) + 1)]
b=b+[1]
for i in range(2, max(a)+1):
    b=b+[(b[i-1] + b[i-2])%c]
s=1
for i in range(m+1):
    s=(s*b[a[i]])%c
print(s)