N, M = map(int, input().split())
MOD = 1000000007
s = [int(input()) for i in range(M)]
s.append(N+1)#最後の段は踏まないといけないので+1

def fiv(n):
  a, b = 0, 1
  if n == 0:
    return 1
  elif n == 1:
    return 1
  else:
    for i in range(n):
      a, b = b, a+b
    return b

r = 1

for j in range(1,M):
  if s[j-1] +1 == s[j]:r = 0

if M == 1:
  r = fiv(s[0]-1)*fiv(N-s[0]-1)
else:
  r = r*fiv(s[0]-1)
  print(r)
  for j in range(1,M+1):
      r = r*fiv(s[j]-s[j-1]-2)

print(r%MOD)