n,m = map(int, input().split())
A = [int(input()) for i in range(m)]
B = [A[i+1]- A[i] for i in range(m-1)]
B.insert(0,A[0]+1)
B.append(n+1-A[m-1])

M = max(A)

def Fib(n):
  L = [0,1]
  for i in range(2,n+3):
    L.append(L[i-2]+L[i-1])
  return(L)

ans = 1
for i in range(len(B)):
  ans = ans * Fib(max(A))[B[i]-1]
  ans = ans % 1000000007
  
print(ans)