import sys
import math

def fb(num):
    a, b = 1, 0
    for _ in range(num-1):
        a, b = a + b, a
    return a


n, m = map(int, input().split())
a = []

for i in range(m):
    a.append(int(input()))

ans = 1
p = 0
for j in range(len(a)):
    if j == 0:
        if a[j] == 0 or a[j] == 1:
            p = a[j]
            continue
        
    if a[j] - p - 1 == 0:
        print("0")
        sys.exit()
        
    ans *= fb(a[j] - p - 1)
    p = a[j]
    if ans > 1000000007:
        ans = ans % 1000000007


if n - p - 1 == 0:
        print("0")
        sys.exit()

        
ans *= fb(n - p)
print(ans % 1000000007)

    






    









                                        




    




        


    







        

