#!/usr/bin/env python3



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):

        if comb[i] != 0:

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



    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 % P_NUM))

#!/usr/bin/env python3



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):

        if comb[i] != 0:

            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
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):
        if comb[i] != 0:
            comb[i] = comb[i - 1] + comb[i - 2]
    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 % P_NUM))

#!/usr/bin/env python3
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):
        if comb[i] != 0:
            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)

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