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

def f(x):
    if x == 1 or x == 0:
        return 1
    else:
        return f(x-1) + f(x-2)

def sol(a):
    for i in range(m - 1):
        if a[i+1] - a[i] == 1:
            print(0)
            return
    mod = 10 ** 9 + 7
    stairs = []
    now = 0
    for i in range(m):
        stairs.append(a[i] - 1 - now)
        now = a[i] + 1
    stairs.append(n - now)

    ans = 1
    for ele in stairs:
        ans *= f(ele)

    print(ans % mod)


sol(a)
    
