MOD = 10**9 + 7



N, M = [int(i) for i in input().strip().split()]

dirty_step_idxs = [0] * M

for i in range(M):

  dirty_step_idx = int(eval(input()))

  dirty_step_idxs[i] = dirty_step_idx



def fibonacci(n):

  # 0, 1, 1, 2, 3, 5, 8, ...

  a, b = 0, 1

  for i in range(n-1):

    a, b = b, a + b

  return a

  

if M == 0:

  res = fibonacci(N + 2)

else:

  res = 1

  now_step_idx = 0

  for i in range(M):

    n_step = dirty_step_idxs[i] - now_step_idx - 1

    if n_step == -1:

      res = 0

      break

    res *= fibonacci(n_step + 2)

    now_step_idx = dirty_step_idxs[i] + 1

  rest_steps = N - now_step_idx

  res *= fibonacci(rest_steps + 2) 

    

print((res % MOD))

import sys



input = sys.stdin.readline



P = 10 ** 9 + 7





def main():

    N, M = list(map(int, input().split()))

    A = [0] * M

    for i in range(M):

        A[i] = int(eval(input()))



    for i in range(M - 1):

        if A[i] + 1 == A[i + 1]:

            print((0))

            exit()



    broken = [False] * (N + 1)

    for a in A:

        broken[a] = True



    dp = [0] * (N + 1)

    dp[0] = 1

    dp[1] = 1 if not broken[1] else 0



    for i in range(2, N + 1):

        if broken[i]:

            dp[i] = 0

        else:

            dp[i] = (dp[i - 1] + dp[i - 2]) % P

    

    ans = dp[N]

    print(ans)





if __name__ == "__main__":

    main()

MOD = 10**9 + 7
N, M = [int(i) for i in input().strip().split()]
dirty_step_idxs = [0] * M
for i in range(M):
    dirty_step_idx = int(eval(input()))
    dirty_step_idxs[i] = dirty_step_idx


def fibonacci(n):
    # 0, 1, 1, 2, 3, 5, 8, ...
    a, b = 0, 1
    for i in range(n - 1):
        a, b = b, a + b
    return a


if M == 0:
    res = fibonacci(N + 2)
else:
    res = 1
    now_step_idx = 0
    for i in range(M):
        n_step = dirty_step_idxs[i] - now_step_idx - 1
        if n_step == -1:
            res = 0
            break
        res *= fibonacci(n_step + 2)
        now_step_idx = dirty_step_idxs[i] + 1
    rest_steps = N - now_step_idx
    res *= fibonacci(rest_steps + 2)
print((res % MOD))

import sys

input = sys.stdin.readline
P = 10**9 + 7


def main():
    N, M = list(map(int, input().split()))
    A = [0] * M
    for i in range(M):
        A[i] = int(eval(input()))
    for i in range(M - 1):
        if A[i] + 1 == A[i + 1]:
            print((0))
            exit()
    broken = [False] * (N + 1)
    for a in A:
        broken[a] = True
    dp = [0] * (N + 1)
    dp[0] = 1
    dp[1] = 1 if not broken[1] else 0
    for i in range(2, N + 1):
        if broken[i]:
            dp[i] = 0
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % P
    ans = dp[N]
    print(ans)


if __name__ == "__main__":
    main()

-MOD = 10**9 + 7 -N, M = [int(i) for i in input().strip().split()] -dirty_step_idxs = [0] * M -for i in range(M): -    dirty_step_idx = int(eval(input())) -    dirty_step_idxs[i] = dirty_step_idx +import sys + +input = sys.stdin.readline +P = 10**9 + 7 -def fibonacci(n): -    # 0, 1, 1, 2, 3, 5, 8, ... -    a, b = 0, 1 -    for i in range(n - 1): -        a, b = b, a + b -    return a +def main(): +    N, M = list(map(int, input().split())) +    A = [0] * M +    for i in range(M): +        A[i] = int(eval(input())) +    for i in range(M - 1): +        if A[i] + 1 == A[i + 1]: +            print((0)) +            exit() +    broken = [False] * (N + 1) +    for a in A: +        broken[a] = True +    dp = [0] * (N + 1) +    dp[0] = 1 +    dp[1] = 1 if not broken[1] else 0 +    for i in range(2, N + 1): +        if broken[i]: +            dp[i] = 0 +        else: +            dp[i] = (dp[i - 1] + dp[i - 2]) % P +    ans = dp[N] +    print(ans) -if M == 0: -    res = fibonacci(N + 2) -else: -    res = 1 -    now_step_idx = 0 -    for i in range(M): -        n_step = dirty_step_idxs[i] - now_step_idx - 1 -        if n_step == -1: -            res = 0 -            break -        res *= fibonacci(n_step + 2) -        now_step_idx = dirty_step_idxs[i] + 1 -    rest_steps = N - now_step_idx -    res *= fibonacci(rest_steps + 2) -print((res % MOD)) +if __name__ == "__main__": +    main()