import sys
import functools
import operator
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]

if n==2 and m==1:
  print('1')
  sys.exit()
    
if n==1:
  if m==0:
    print('1')
    sys.exit()
  else:
    print('0')

def s(x):
    if x==1 or x==0:
        return 1
    if x==2:
        return x
    return s(x-1)+s(x-2)
    
if m==0:
  print(s(n))
  sys.exit()

c=[]

p=s(a[0]-1)
c.append(p)

for i in range(1,m):
  if a[i]-a[i-1]==1:
    print('0')
    sys.exit()
  else:
    q=s(a[i]-a[i-1]-2)
    c.append(q)
  
r=s(n-(a[m-1]+1))
c.append(r)

ans=functools.reduce(operator.mul,c)
print(ans%(10**9+7))
