#!/usr/bin/env python3



import array





P_NUM = 1000000007





def solv(n, m, a):

    comb = array.array('I', [1] * (n+1))

    for i in a:

        comb[i] = 0



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

        comb[i] *= (comb[i-1] + comb[i-2]) % P_NUM



    return comb[-1]





if __name__ == '__main__':



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

    a = [int(eval(input())) for _ in range(m)]



    ans = solv(n, m, a)



    print(ans)

#!/usr/bin/env python3



import sys



P_NUM = 1000000007





def solv(n, m, a):

    comb =  [1] * (n+1)

    for i in a:

        comb[i] = 0



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

        comb[i] *= (comb[i-1] + comb[i-2]) % P_NUM



    return comb[-1]





if __name__ == '__main__':



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

    if m:

        a = list(map(int, sys.stdin))

    else:

        a = []



    ans = solv(n, m, a)



    print(ans)
#!/usr/bin/env python3
import array

P_NUM = 1000000007


def solv(n, m, a):
    comb = array.array("I", [1] * (n + 1))
    for i in a:
        comb[i] = 0
    for i in range(2, n + 1):
        comb[i] *= (comb[i - 1] + comb[i - 2]) % P_NUM
    return comb[-1]


if __name__ == "__main__":
    n, m = list(map(int, input().split()))
    a = [int(eval(input())) for _ in range(m)]
    ans = solv(n, m, a)
    print(ans)

#!/usr/bin/env python3
import sys

P_NUM = 1000000007


def solv(n, m, a):
    comb = [1] * (n + 1)
    for i in a:
        comb[i] = 0
    for i in range(2, n + 1):
        comb[i] *= (comb[i - 1] + comb[i - 2]) % P_NUM
    return comb[-1]


if __name__ == "__main__":
    n, m = list(map(int, input().split()))
    if m:
        a = list(map(int, sys.stdin))
    else:
        a = []
    ans = solv(n, m, a)
    print(ans)

-import array +import sys -    comb = array.array("I", [1] * (n + 1)) +    comb = [1] * (n + 1) -    a = [int(eval(input())) for _ in range(m)] +    if m: +        a = list(map(int, sys.stdin)) +    else: +        a = []