n,m=map(int,input().split())
h = []
for i in range(0,m):
  h.append(int(input()))
now = 0
s = 1
arr = [0,1,2]
for i in range(1,n-1):
  arr.append(arr[i]+arr[i+1])

"""
def c(i):
  if 0 <= i <= 2:
    return i
  else:
    return c(i-2) + c(i-1)
"""
def check(h):
  if m == 1:
    return 0
  if m == 2 and h[0]+1 == h[1]:
    return -1
  for i in range(0,m-2):
    if h[i] + 1 == h[i+1]:
      return -1
  return 0

if check(h) == 0:
  for i in h:
    b = i - now - 1
    if b > 0:
      s = (s * arr[b]) % 1000000007
    now = i + 1
  s = (s * arr[n-now]) % 1000000007
  print(s)
else:
  print(0)