n,m = map(int,input().split())
a = list(range(m+2))
a[0] = 0
a[m+1] = n+1
ans = 1
for i in range(m):
  a[i+1] = int(input())
for i in range(m+1):
  if a[i]+1 == a[i+1] and i != 0 and i != m:
    ans = 0
    break
  else:
    x = a[i+1]-a[i]-2
    if x == 0 or x == 1:
      ans = ans%1000000007
    elif x == 2:
      ans = ans*2%1000000007
    else:
      ans = ans * int(1/(5**0.5) * (((1+(5**0.5))/2)**x - ((1-(5**0.5))/2)**x)) %1000000007

print(ans)
