def step(n):
    if n == 0:
        return 1
    steps = [0 for i in range(n + 2)]
    steps[1] = 1
    steps[2] = 2
    for i in range(3, n + 1):
        steps[i] = steps[i - 1] + steps[i - 2]
    return steps[n]

n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]

a.append(n)

sum = 1

for i in range(m + 1):

  if i == 0:
    sum *= step(a[i] - 1)
    continue

  elif a[i] - a[i-1] == 1:
    print(0)
    break

  elif i == m:
    sum *= step(a[m] - a[m-1] -1)

  else:
    sum *= step(a[i] - a[i-1] -2)

print(sum % 1000000007)