#  --*-coding:utf-8-*--



MOD =  1000000007



def f(N, A):

    A.append(-1)



    a = A.pop(0)



    c0 = 0

    c1 = 1



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

        c0, c1 = c1, (c0+c1)%MOD



        if i == a:

            c1 = 0

            a = A.pop(0)



    return c1

            





def main():

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

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



    print((f(N, A)))





if __name__ == '__main__':

    main()

#  --*-coding:utf-8-*--



MOD =  1000000007



def f(N, A):

    c0 = 0

    c1 = 1



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

        c0, c1 = c1, (c0+c1)%MOD



        if i in A:

            c1 = 0



    return c1

            





def main():

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

    A = set(int(eval(input())) for i in range(M))

    print((f(N, A)))





if __name__ == '__main__':

    main()

#  --*-coding:utf-8-*--
MOD = 1000000007


def f(N, A):
    A.append(-1)
    a = A.pop(0)
    c0 = 0
    c1 = 1
    for i in range(1, N + 1):
        c0, c1 = c1, (c0 + c1) % MOD
        if i == a:
            c1 = 0
            a = A.pop(0)
    return c1


def main():
    N, M = list(map(int, input().split()))
    A = [int(eval(input())) for i in range(M)]
    print((f(N, A)))


if __name__ == "__main__":
    main()

#  --*-coding:utf-8-*--
MOD = 1000000007


def f(N, A):
    c0 = 0
    c1 = 1
    for i in range(1, N + 1):
        c0, c1 = c1, (c0 + c1) % MOD
        if i in A:
            c1 = 0
    return c1


def main():
    N, M = list(map(int, input().split()))
    A = set(int(eval(input())) for i in range(M))
    print((f(N, A)))


if __name__ == "__main__":
    main()

-    A.append(-1) -    a = A.pop(0) -        if i == a: +        if i in A: -            a = A.pop(0) -    A = [int(eval(input())) for i in range(M)] +    A = set(int(eval(input())) for i in range(M))