# -*- coding: utf-8 -*-

n, m = map(int, input().split())

a = [int(input()) for i in range(m)]
a.append(n+1)

ar = list(range(n+1))

tmp = 0
ans = 1
counter = 0

# def fib1(n):
#     global counter
#     counter += 1
#     if n in [0, 1]:
#         return 1
#     return fib1(n - 1) + fib1(n - 2)
from functools import lru_cache
counter = 0
@lru_cache(maxsize=1024)
def fib1(n):
    global counter
    counter += 1
    if n in [0, 1]:
        return 1
    return fib1(n - 1) + fib1(n - 2)

for i in range(len(a)):
    cnt = len(ar[tmp:a[i]])
    ans = (ans*(fib1(cnt-1)%1000000007))%1000000007
    if i+1 < len(a):
        if a[i]+1 == a[i+1]:
            print(0)
            exit()
    tmp = a[i]+1

print(ans)

