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
for j in range(len(a)-1):      
    if a[j+1] - a[j] - 1 == 0:
        print("0")
        sys.exit()
        
    ans *= fb(a[j+1] - a[j] - 1)
    if ans > 1000000007:
        ans = ans % 1000000007

if a[0] > 1:
    ans *= fb(a[0])

if n - a[m-1] - 1 == 0:
    print("0")
    sys.exit()
        
ans *= fb(n - a[m-1])
print(ans % 1000000007)
            
        
            
        
    
        


