
import sys
sys.setrecursionlimit(10030)

memo=[0]*10**5
memo[0]=1
memo[1]=1

def fib(n):
#  print(n)
  ret=0
  if n==0 or n==1:
    return 1
  if memo[n-1]!=0:
    ret+=memo[n-1]
  else:
    ret+=fib(n-1)
  if memo[n-2]!=0:
    ret+=memo[n-2]
  else:
    ret+=fib(n-2)
  while(ret>10**9+7):
    ret%=10**9+7
  memo[n]=ret
  return ret


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)