import sys
from operator import itemgetter

sys.setrecursionlimit(10**9)
input = sys.stdin.readline

def ii(): return int(input())
def mi(): return map(int, input().split())
def lmi(): return list(map(int, input().split()))
def iif(n): return [int(input()) for _ in range(n)]
def lmif(n): return [list(map(int, input().split())) for _ in range(n)]
def ss(): return input().split()

def main():
    mod = 1000000007

    F = [1, 1]
    for i in range(100000):
        F.append(F[i] + F[i+1])

    N, M = mi()

    if M == 0:
        print(F[N] % mod)
        return

    A = iif(M)
    DA = []
    left = 0
    for i in range(M):
        da = A[i] - left
        if da == 0 and left != 0:
            print(0)
            return
        else:
            DA.append(da-1)
        left = A[i] + 1
    if A[-1] != N:
        DA.append(N - A[-1] - 1)


    ans = 1
    for i in DA:
        ans *= F[i]

    print(ans % mod)

    return

main() import sys sys from operator import itemgetter sys.setrecursionlimit(10**9) sys.setrecursionlimit sys setrecursionlimit 10**9 10 9 input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def ii(): return int(input()) ii def mi(): return map(int, input().split()) mi def lmi(): return list(map(int, input().split())) lmi int(input()) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) int(input()) int input() input def iif(n): return [int(input()) for _ in range(n)] iif n n list(map(int, input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def lmif(n): return [list(map(int, input().split())) for _ in range(n)] lmif n n def ss(): return input().split() ss def main():
    mod = 1000000007

    F = [1, 1]
    for i in range(100000):
        F.append(F[i] + F[i+1])

    N, M = mi()

    if M == 0:
        print(F[N] % mod)
        return

    A = iif(M)
    DA = []
    left = 0
    for i in range(M):
        da = A[i] - left
        if da == 0 and left != 0:
            print(0)
            return
        else:
            DA.append(da-1)
        left = A[i] + 1
    if A[-1] != N:
        DA.append(N - A[-1] - 1)


    ans = 1
    for i in DA:
        ans *= F[i]

    print(ans % mod)

    return main mod = 1000000007 mod 1000000007 F = [1, 1] F [1, 1] 1 1 for i in range(100000):
        F.append(F[i] + F[i+1])

     i range(100000) range 100000 F.append(F[i] + F[i+1]) F.append F append F[i] + F[i+1] F[i] F i F[i+1] F i+1 i 1 N, M = mi() N mi() mi M if M == 0:
        print(F[N] % mod)
        return

     M == 0 M 0 print(F[N] % mod) print F[N] % mod F[N] F N mod return A = iif(M) A iif(M) iif M DA = [] DA [] left = 0 left 0 for i in range(M):
        da = A[i] - left
        if da == 0 and left != 0:
            print(0)
            return
        else:
            DA.append(da-1)
        left = A[i] + 1
     i range(M) range M da = A[i] - left da A[i] - left A[i] A i left if da == 0 and left != 0:
            print(0)
            return
        else:
            DA.append(da-1)
         da == 0 and left != 0 da == 0 da 0 left != 0 left 0 print(0) print 0 return DA.append(da-1) DA.append DA append da-1 da 1 left = A[i] + 1 left A[i] + 1 A[i] A i 1 if A[-1] != N:
        DA.append(N - A[-1] - 1)


     A[-1] != N A[-1] A -1 N DA.append(N - A[-1] - 1) DA.append DA append N - A[-1] - 1 N - A[-1] N A[-1] A -1 1 ans = 1 ans 1 for i in DA:
        ans *= F[i]

     i DA ans *= F[i] ans F[i] F i print(ans % mod) print ans % mod ans mod return main() main def ss(): return input().split() def ss(): return input().split() ss def mi(): return map(int, input().split()) def mi(): return map(int, input().split()) mi def lmif(n): return [list(map(int, input().split())) for _ in range(n)] def lmif(n): return [list(map(int, input().split())) for _ in range(n)] lmif input = sys.stdin.readline sys.stdin.readline input def ii(): return int(input()) def ii(): return int(input()) ii def main():
    mod = 1000000007

    F = [1, 1]
    for i in range(100000):
        F.append(F[i] + F[i+1])

    N, M = mi()

    if M == 0:
        print(F[N] % mod)
        return

    A = iif(M)
    DA = []
    left = 0
    for i in range(M):
        da = A[i] - left
        if da == 0 and left != 0:
            print(0)
            return
        else:
            DA.append(da-1)
        left = A[i] + 1
    if A[-1] != N:
        DA.append(N - A[-1] - 1)


    ans = 1
    for i in DA:
        ans *= F[i]

    print(ans % mod)

    return def main():
    mod = 1000000007

    F = [1, 1]
    for i in range(100000):
        F.append(F[i] + F[i+1])

    N, M = mi()

    if M == 0:
        print(F[N] % mod)
        return

    A = iif(M)
    DA = []
    left = 0
    for i in range(M):
        da = A[i] - left
        if da == 0 and left != 0:
            print(0)
            return
        else:
            DA.append(da-1)
        left = A[i] + 1
    if A[-1] != N:
        DA.append(N - A[-1] - 1)


    ans = 1
    for i in DA:
        ans *= F[i]

    print(ans % mod)

    return main def iif(n): return [int(input()) for _ in range(n)] def iif(n): return [int(input()) for _ in range(n)] iif def lmi(): return list(map(int, input().split())) def lmi(): return list(map(int, input().split())) lmi
import sys
from operator import itemgetter

sys.setrecursionlimit(10**9)
input = sys.stdin.readline

def ii(): return int(input())
def mi(): return map(int, input().split())
def lmi(): return list(map(int, input().split()))
def iif(n): return [int(input()) for _ in range(n)]
def lmif(n): return [list(map(int, input().split())) for _ in range(n)]
def ss(): return input().split()

def main():
    mod = 1000000007

    F = [1, 1]
    for i in range(100000):
        F.append(F[i] + F[i+1])

    N, M = mi()

    if M == 0:
        print(F[N] % mod)
        return

    A = iif(M)
    DA = []
    left = 0
    for i in range(M):
        da = A[i] - left
        if da == 0 and left != 0:
            print(0)
            return
        else:
            DA.append(da-1)
        left = A[i] + 1
    if A[-1] != N:
        DA.append(N - A[-1] - 1)


    ans = 1
    for i in DA:
        ans *= F[i]

    print(ans % mod)

    return

main()
