def Fib(n, memo={}):
    if n < 2:
        return 1
    elif n in memo:
        return memo[n]
    else:
        memo[n] = Fib(n - 1, memo) + Fib(n - 2, memo)
        return memo[n]


def resolve():
    N, M = [int(i) for i in input().split()]
    aa = []
    for _ in range(M):
        aa.append(int(input()))
    # fib_l = list(Fib(i) for i in range(N + 1))

    ans = 1
    now = 0
    for a in aa:
        if now == a:
            ans = 0
            break
        tmp = a - now - 1
        # ans = ans * fib_l[tmp]
        ans = ans * Fib(tmp)
        now = a + 1
    else:
        # ans = ans * fib_l[N - now]
        ans = ans * Fib(N - now)
    print(ans % (10**9 + 7))


resolve()
