#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10 ** 7)

MOD = 1000000007  # type: int


def solve(N: int, M: int, a: "List[int]"):
    lst = [0 for i in range(N + 2)]
    lst[1] = 1
    for i in range(2, N + 2):
        if i - 1 in a:
            lst[i] = 0
        else:
            lst[i] = lst[i - 1] + lst[i - 2]
            lst[i] %= MOD

    print(lst[N + 1])
    # print(lst)
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools
# (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(M)]  # type: "List[int]"
    solve(N, M, a)


if __name__ == '__main__':
    main()
