#!/usr/bin/env python3
def main():
    N, M = map(int, input().split())
    A = set([int(input()) for x in range(M)])

    mod = 10 ** 9 + 7
    dp = [0] * 10 ** 6
    dp[0] = 1
    for i in range(N + 1):
        if i in A:
            continue
        dp[i + 1] += dp[i] % mod
        dp[i + 2] += dp[i] % mod
    print(dp[N] % mod)


if __name__ == '__main__':
    main() def main():
    N, M = map(int, input().split())
    A = set([int(input()) for x in range(M)])

    mod = 10 ** 9 + 7
    dp = [0] * 10 ** 6
    dp[0] = 1
    for i in range(N + 1):
        if i in A:
            continue
        dp[i + 1] += dp[i] % mod
        dp[i + 2] += dp[i] % mod
    print(dp[N] % mod) main N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M int(input()) for x in range(M) for x in range(M) x range(M) range M for x in range(M) int(input()) int input() input A = set([int(input()) for x in range(M)]) A set([int(input()) for x in range(M)]) set [int(input()) for x in range(M)] mod = 10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 dp = [0] * 10 ** 6 dp [0] * 10 ** 6 [0] 0 10 ** 6 10 6 dp[0] = 1 dp[0] dp 0 1 for i in range(N + 1):
        if i in A:
            continue
        dp[i + 1] += dp[i] % mod
        dp[i + 2] += dp[i] % mod
     i range(N + 1) range N + 1 N 1 if i in A:
            continue
         i in A i A continue dp[i + 1] += dp[i] % mod dp[i + 1] dp i + 1 i 1 dp[i] % mod dp[i] dp i mod dp[i + 2] += dp[i] % mod dp[i + 2] dp i + 2 i 2 dp[i] % mod dp[i] dp i mod print(dp[N] % mod) print dp[N] % mod dp[N] dp N mod if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N, M = map(int, input().split())
    A = set([int(input()) for x in range(M)])

    mod = 10 ** 9 + 7
    dp = [0] * 10 ** 6
    dp[0] = 1
    for i in range(N + 1):
        if i in A:
            continue
        dp[i + 1] += dp[i] % mod
        dp[i + 2] += dp[i] % mod
    print(dp[N] % mod) def main():
    N, M = map(int, input().split())
    A = set([int(input()) for x in range(M)])

    mod = 10 ** 9 + 7
    dp = [0] * 10 ** 6
    dp[0] = 1
    for i in range(N + 1):
        if i in A:
            continue
        dp[i + 1] += dp[i] % mod
        dp[i + 2] += dp[i] % mod
    print(dp[N] % mod) main
#!/usr/bin/env python3
def main():
    N, M = map(int, input().split())
    A = set([int(input()) for x in range(M)])

    mod = 10 ** 9 + 7
    dp = [0] * 10 ** 6
    dp[0] = 1
    for i in range(N + 1):
        if i in A:
            continue
        dp[i + 1] += dp[i] % mod
        dp[i + 2] += dp[i] % mod
    print(dp[N] % mod)


if __name__ == '__main__':
    main()
