import math
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
ans=1

def fib(n):
  if n==1:
    return 1
  elif n<=0:
    return 0
  tmp1,tmp2=1,2
  for _ in range(n-2):
    tmp1,tmp2=tmp2,tmp1+tmp2
  return tmp2

for i in range(m):
  if i==0 and a[0]==1:
    pass
  if i==0 and a[0]!=1:
    ans*=a[i]-1
  elif i>0:
  	ans*=fib(a[i]-a[i-1]-2)
  ans%=1000000007

ans*=fib(n-a[-1]-1)
ans%=1000000007
print(ans)