from functools import lru_cache
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
a=sorted(a)
@lru_cache(maxsize=None) 
def fib(n): 
    if n <= 1:
        return 1
    else:
        return fib(n - 2) + fib(n - 1)
ans=fib(a[0])*fib(n-a[-1])
for i in range(1,m):
  if a[i]-a[i-1]==1:
    print(0)
    exit()
  elif m==1:
    print(ans)
    exit()
  ans=ans*fib(a[i]-a[i-1]-1)
print(ans%1000000007)