import numpy as np
import sys
sys.setrecursionlimit(10**5)

def main(N, M, a_list):
    fib_memo = {}
    fib_memo[0] = 1
    fib_memo[1] = 1
    def fib(n):
        if n not in fib_memo:
            fib_memo[n] = fib(n-1) + fib(n-2)
        return fib_memo[n]

    mul = 1
    old_a = 0

    for a in a_list:
        if a != 1 and old_a == a - 1:
            print(0)
            return

        mul *= (fib(a - old_a - 1) % 1000000007)
        old_a = a
        

    mul *= (fib(N - a_list[-1] -1) % 1000000007)
    print(mul % 1000000007)




if __name__ == "__main__":
    N, M = [int(x) for x in input().split()]
    a_list = []
    for _ in range(M):
        a_list.append(int(input()))

    main(N, M, a_list)
