n,m = map(int,input().split())
a = list(range(m+2))
a[0] = -1
a[m+1] = n+1
ans = 1
if m == 0:
    x = a[m+1]-a[i]-1
    ans = int(1/(5**0.5) * (((1+(5**0.5))/2)**x - ((1-(5**0.5))/2)**x)) %1000000007
else:
  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]-1
      ans = ans * int(1/(5**0.5) * (((1+(5**0.5))/2)**x - ((1-(5**0.5))/2)**x)) %1000000007

print(ans)
