import sys

input = sys.stdin.readline





def typical_stairs():

    n, m = list(map(int, input().split()))

    dangerous = set(int(eval(input())) for _ in range(m))

    mod = 1000000007

    dp = [0] * (n + 1)

    dp[0] = 1

    if 1 not in dangerous:

        dp[1] = 1

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

        if i not in dangerous:

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

    print((dp[-1]))





if __name__ == '__main__':

    typical_stairs()

def typical_stairs():

    n, m, *dangerous = list(map(int, open(0).read().split()))

    dangerous = set(dangerous)

    mod = 1000000007

    dp = [0] * (n + 1)

    dp[0] = 1

    if 1 not in dangerous:

        dp[1] = 1

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

        if i not in dangerous:

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

    print((dp[-1]))





if __name__ == '__main__':

    typical_stairs()

import sys

input = sys.stdin.readline


def typical_stairs():
    n, m = list(map(int, input().split()))
    dangerous = set(int(eval(input())) for _ in range(m))
    mod = 1000000007
    dp = [0] * (n + 1)
    dp[0] = 1
    if 1 not in dangerous:
        dp[1] = 1
    for i in range(2, n + 1):
        if i not in dangerous:
            dp[i] = (dp[i - 2] + dp[i - 1]) % mod
    print((dp[-1]))


if __name__ == "__main__":
    typical_stairs()

def typical_stairs():
    n, m, *dangerous = list(map(int, open(0).read().split()))
    dangerous = set(dangerous)
    mod = 1000000007
    dp = [0] * (n + 1)
    dp[0] = 1
    if 1 not in dangerous:
        dp[1] = 1
    for i in range(2, n + 1):
        if i not in dangerous:
            dp[i] = (dp[i - 2] + dp[i - 1]) % mod
    print((dp[-1]))


if __name__ == "__main__":
    typical_stairs()

-import sys - -input = sys.stdin.readline - - -    n, m = list(map(int, input().split())) -    dangerous = set(int(eval(input())) for _ in range(m)) +    n, m, *dangerous = list(map(int, open(0).read().split())) +    dangerous = set(dangerous)