import sys
sys.setrecursionlimit(10000000) 

def resolve():
    (N, M) = list(map(int, input().split(" ")))
    As = [int(input()) for i in range(M)]
    # mems = [False] * (N+1)

    cnts = [False] * (N+1)
    for i in range(N+1):
        c = 0
        if i in As:
            c = 0
        elif i == 0:
            c = 1
        elif i == 1:
            c = 1
        elif i == 2:
            c = 2 if 1 not in As else 1
        else:
            c = cnts[i-2] + cnts[i-1]
        cnts[i] = c
        print("cnt[{}] = {}".format(str(i), str(c)))

    print(cnts[N]%1000000007)
    # for i in range(N-1):
    #     if i in As and i+1 in As:
    #         return 0 

    # def rec(target):
    #     if target in As:
    #         return 0
        
    #     if target == 1:
    #         return 1
        
    #     if target == 2:
    #         return 2 if 1 not in As else 1

    #     if not mems[target]:
    #         one = rec(target-1)
    #         two = rec(target-2)
    #         mems[target] = one + two
        
    #     return mems[target]
    # print(rec(N)%1000000007)

if '__main__' == __name__:
    resolve()