# ABC129C - Typical Stairs

import sys

input = sys.stdin.readline



def main():

    N, M = tuple(map(int, input().rstrip().split()))

    A = set(map(int, [input().rstrip() for _ in range(M)]))

    MOD = 10 ** 9 + 7

    dp = [0] * (N + 1)

    dp[:2] = 1, 1 if 1 not in A else 0

    for i in range(2, N + 1):

        if i in A:

            continue

        else:

            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD

    print((dp[-1]))





if __name__ == "__main__":

    main()
# ABC129C - Typical Stairs

import sys

input = sys.stdin.readline



def main():

    N, M = tuple(map(int, input().split()))

    A = set(map(int, [eval(input()) for _ in range(M)]))

    MOD = 10 ** 9 + 7

    dp = [0] * (N + 1)

    dp[:2] = 1, 1 if 1 not in A else 0

    for i in range(2, N + 1):

        if i in A:

            continue

        else:

            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD

    print((dp[-1]))





if __name__ == "__main__":

    main()

# ABC129C - Typical Stairs
import sys

input = sys.stdin.readline


def main():
    N, M = tuple(map(int, input().rstrip().split()))
    A = set(map(int, [input().rstrip() for _ in range(M)]))
    MOD = 10**9 + 7
    dp = [0] * (N + 1)
    dp[:2] = 1, 1 if 1 not in A else 0
    for i in range(2, N + 1):
        if i in A:
            continue
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD
    print((dp[-1]))


if __name__ == "__main__":
    main()

# ABC129C - Typical Stairs
import sys

input = sys.stdin.readline


def main():
    N, M = tuple(map(int, input().split()))
    A = set(map(int, [eval(input()) for _ in range(M)]))
    MOD = 10**9 + 7
    dp = [0] * (N + 1)
    dp[:2] = 1, 1 if 1 not in A else 0
    for i in range(2, N + 1):
        if i in A:
            continue
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD
    print((dp[-1]))


if __name__ == "__main__":
    main()

-    N, M = tuple(map(int, input().rstrip().split())) -    A = set(map(int, [input().rstrip() for _ in range(M)])) +    N, M = tuple(map(int, input().split())) +    A = set(map(int, [eval(input()) for _ in range(M)]))