#!/usr/bin/env python3



P_NUM = 1000000007





def solv(n, m, a):

    no_hole = [1] * (n+1)

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

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



    ans = 1

    start = 0

    for broken in a:

        dist = broken-1-start

        if dist < 0:

            return 0

        ans *= no_hole[dist] % P_NUM

        start = broken+1



    dist = n-start

    if dist < 0:

        return 0

    ans *= no_hole[dist] % P_NUM



    return ans % P_NUM





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

    no_hole = [1] * (n+1)

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

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



    ans = 1

    start = 0

    for broken in a:

        dist = broken-1-start

        if dist < 0:

            return 0

        ans *= no_hole[dist] % P_NUM

        start = broken+1



    dist = n-start

    if dist < 0:

        return 0

    ans *= no_hole[dist] % P_NUM



    return ans % P_NUM





if __name__ == '__main__':



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

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



    ans = solv(n, m, a)



    print(ans)

#!/usr/bin/env python3
P_NUM = 1000000007


def solv(n, m, a):
    no_hole = [1] * (n + 1)
    for i in range(2, n + 1):
        no_hole[i] = no_hole[i - 1] + no_hole[i - 2]
    ans = 1
    start = 0
    for broken in a:
        dist = broken - 1 - start
        if dist < 0:
            return 0
        ans *= no_hole[dist] % P_NUM
        start = broken + 1
    dist = n - start
    if dist < 0:
        return 0
    ans *= no_hole[dist] % P_NUM
    return ans % P_NUM


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):
    no_hole = [1] * (n + 1)
    for i in range(2, n + 1):
        no_hole[i] = no_hole[i - 1] + no_hole[i - 2]
    ans = 1
    start = 0
    for broken in a:
        dist = broken - 1 - start
        if dist < 0:
            return 0
        ans *= no_hole[dist] % P_NUM
        start = broken + 1
    dist = n - start
    if dist < 0:
        return 0
    ans *= no_hole[dist] % P_NUM
    return ans % P_NUM


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

+import sys + -    a = [int(eval(input())) for _ in range(m)] +    a = list(map(int, sys.stdin))