
import sys
from functools import lru_cache
sys.setrecursionlimit(12000)

@lru_cache(maxsize=8)
def fib(n):
  if n==0:
    return 1
  if n==1:
    return 1
  return fib(n-1)+fib(n-2)

n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]
a.append(n+1)
prv=0
ans=1
for ai in a:
  if(ai==prv):
    ans=0
    break
  ans*=fib(ai-1-prv)
  while(ans>10**9+7):
    ans%=10**9+7

  prv=ai+1

print(ans)