N, M = map(int, input().split())
S = []
for _ in range(M):
    S.append(int(input()))
def fib(n):
  if n==0:
    return 0
  else:
    a, b = 0, 1
    for i in range(n):
        a, b = b, a + b
    return b
if S[0]==1:
  c=1
else:
  c=fib(S[0]-1)
for i in range(M-1):
  c=c*fib(S[i+1]-S[i]-2)
c=c*fib(N-S[M-1]-1)
c=c%1000000007
print(c)