def resolve():
    import sys
    input = sys.stdin.readline
    # 整数 1 つ
    #n, m = int(input())
    # 整数複数個
    n, m = map(int, input().split())
    # 整数 N 個 (改行区切り)
    A = [int(input()) for i in range(m)]
    # 整数 N 個 (スペース区切り)
    #A = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    Route = [0] * (n+1)
    Route[0] = 1
    if 1 not in A:
        Route[1] = 1
    MOD = 10**9 + 7
    for i in range(2, n+1):
        if i not in A:
            Route[i] = (Route[i-1] + Route[i-2]) % MOD
#            Route[i] %= MOD

    print(Route[n])
#    print(Route)
resolve()