#!/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 sys



P_NUM = 1000000007





def solv(n, m, a):

    comb_m2 = 1

    if 1 in a:

        comb_m1 = 0

    else:

        comb_m1 = 1



    comb = 1

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

        if i in a:

            comb = 0

        else:

            comb = (comb_m1 + comb_m2) % P_NUM



        comb_m1, comb_m2 = comb, comb_m1



    return comb





if __name__ == '__main__':



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

    if m:

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

    else:

        a = set()



    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 sys

P_NUM = 1000000007


def solv(n, m, a):
    comb_m2 = 1
    if 1 in a:
        comb_m1 = 0
    else:
        comb_m1 = 1
    comb = 1
    for i in range(2, n + 1):
        if i in a:
            comb = 0
        else:
            comb = (comb_m1 + comb_m2) % P_NUM
        comb_m1, comb_m2 = comb, comb_m1
    return comb


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

-    comb = [1] * (n + 1) -    for i in a: -        comb[i] = 0 +    comb_m2 = 1 +    if 1 in a: +        comb_m1 = 0 +    else: +        comb_m1 = 1 +    comb = 1 -        comb[i] *= (comb[i - 1] + comb[i - 2]) % P_NUM -    return comb[-1] +        if i in a: +            comb = 0 +        else: +            comb = (comb_m1 + comb_m2) % P_NUM +        comb_m1, comb_m2 = comb, comb_m1 +    return comb -        a = list(map(int, sys.stdin)) +        a = set(map(int, sys.stdin)) -        a = [] +        a = set()