import sys



def main():

    input = sys.stdin.readline

    MOD = 10**9 + 7

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

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

    is_safe = [True] * (N+1)

    for a in A:

        is_safe[a] = False



    dp = [0] * (N+2)

    dp[1] = 1

    for i in range(N):

        step = i+2

        if is_safe[i+1]:

            dp[step] = dp[step-1] + dp[step-2]

            dp[step] %= MOD

        else:

            dp[step] = 0



    return dp[N+1]





if __name__ == '__main__':

    print((main()))

import sys



def main():

    input = sys.stdin.readline

    MOD = 10**9 + 7

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

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

    is_safe = [True] * (N+2)

    for a in A:

        is_safe[a+1] = False



    dp = [0] * (N+2)

    dp[1] = 1

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

        if is_safe[i]:

            dp[i] = dp[i-1] + dp[i-2]

            dp[i] %= MOD

        else:

            dp[i] = 0



    return dp[N+1]





if __name__ == '__main__':

    print((main()))

import sys


def main():
    input = sys.stdin.readline
    MOD = 10**9 + 7
    N, M = list(map(int, input().split()))
    A = [int(eval(input())) for _ in range(M)]
    is_safe = [True] * (N + 1)
    for a in A:
        is_safe[a] = False
    dp = [0] * (N + 2)
    dp[1] = 1
    for i in range(N):
        step = i + 2
        if is_safe[i + 1]:
            dp[step] = dp[step - 1] + dp[step - 2]
            dp[step] %= MOD
        else:
            dp[step] = 0
    return dp[N + 1]


if __name__ == "__main__":
    print((main()))

import sys


def main():
    input = sys.stdin.readline
    MOD = 10**9 + 7
    N, M = list(map(int, input().split()))
    A = [int(eval(input())) for _ in range(M)]
    is_safe = [True] * (N + 2)
    for a in A:
        is_safe[a + 1] = False
    dp = [0] * (N + 2)
    dp[1] = 1
    for i in range(2, N + 2):
        if is_safe[i]:
            dp[i] = dp[i - 1] + dp[i - 2]
            dp[i] %= MOD
        else:
            dp[i] = 0
    return dp[N + 1]


if __name__ == "__main__":
    print((main()))

-    is_safe = [True] * (N + 1) +    is_safe = [True] * (N + 2) -        is_safe[a] = False +        is_safe[a + 1] = False -    for i in range(N): -        step = i + 2 -        if is_safe[i + 1]: -            dp[step] = dp[step - 1] + dp[step - 2] -            dp[step] %= MOD +    for i in range(2, N + 2): +        if is_safe[i]: +            dp[i] = dp[i - 1] + dp[i - 2] +            dp[i] %= MOD -            dp[step] = 0 +            dp[i] = 0