def fib(n):
    if n <= 1:
        return n
    result = [1, 0, 0, 1]
    matrix = [1, 1, 1, 0]
    while n > 0:
        if n % 2:
            result = mul(matrix, result)
        matrix = mul(matrix, matrix)
        n //= 2
    return result[2]

def mul(a, b):
    return [a[0]*b[0] + a[1]*b[2],
            a[0]*b[1] + a[1]*b[3],
            a[2]*b[0] + a[3]*b[2],
            a[2]*b[1] + a[3]*b[3]]
    
N, M = map(int, input().split())
if N == 1:
    print(1)
    quit()
S = [-1]
for i in range(M):
    S.append(int(input()))
S.append(N + 1)
S = [S[i + 1] - S[i] for i in range(M + 1)]
if any([x == 1 for x in S]):
    print(0)
    exit()
num = 1
for x in S:
    num *=  fib(x - 1)
    num = num % 1000000007
print(num) def fib(n):
    if n <= 1:
        return n
    result = [1, 0, 0, 1]
    matrix = [1, 1, 1, 0]
    while n > 0:
        if n % 2:
            result = mul(matrix, result)
        matrix = mul(matrix, matrix)
        n //= 2
    return result[2] fib if n <= 1:
        return n
     n <= 1 n 1 return n n result = [1, 0, 0, 1] result [1, 0, 0, 1] 1 0 0 1 matrix = [1, 1, 1, 0] matrix [1, 1, 1, 0] 1 1 1 0 while n > 0:
        if n % 2:
            result = mul(matrix, result)
        matrix = mul(matrix, matrix)
        n //= 2
     n > 0 n 0 if n % 2:
            result = mul(matrix, result)
         n % 2 n 2 result = mul(matrix, result) result mul(matrix, result) mul matrix result matrix = mul(matrix, matrix) matrix mul(matrix, matrix) mul matrix matrix n //= 2 n 2 return result[2] result[2] result 2 n n def mul(a, b):
    return [a[0]*b[0] + a[1]*b[2],
            a[0]*b[1] + a[1]*b[3],
            a[2]*b[0] + a[3]*b[2],
            a[2]*b[1] + a[3]*b[3]]
     mul return [a[0]*b[0] + a[1]*b[2],
            a[0]*b[1] + a[1]*b[3],
            a[2]*b[0] + a[3]*b[2],
            a[2]*b[1] + a[3]*b[3]] [a[0]*b[0] + a[1]*b[2],
            a[0]*b[1] + a[1]*b[3],
            a[2]*b[0] + a[3]*b[2],
            a[2]*b[1] + a[3]*b[3]] a[0]*b[0] + a[1]*b[2] a[0]*b[0] a[0] a 0 b[0] b 0 a[1]*b[2] a[1] a 1 b[2] b 2 a[0]*b[1] + a[1]*b[3] a[0]*b[1] a[0] a 0 b[1] b 1 a[1]*b[3] a[1] a 1 b[3] b 3 a[2]*b[0] + a[3]*b[2] a[2]*b[0] a[2] a 2 b[0] b 0 a[3]*b[2] a[3] a 3 b[2] b 2 a[2]*b[1] + a[3]*b[3] a[2]*b[1] a[2] a 2 b[1] b 1 a[3]*b[3] a[3] a 3 b[3] b 3 a a b b N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M if N == 1:
    print(1)
    quit() N == 1 N 1 print(1) print 1 quit() quit S = [-1] S [-1] -1 for i in range(M):
    S.append(int(input())) i range(M) range M S.append(int(input())) S.append S append int(input()) int input() input S.append(N + 1) S.append S append N + 1 N 1 S[i + 1] - S[i] for i in range(M + 1) for i in range(M + 1) i range(M + 1) range M + 1 M 1 for i in range(M + 1) S[i + 1] - S[i] S[i + 1] S i + 1 i 1 S[i] S i S = [S[i + 1] - S[i] for i in range(M + 1)] S [S[i + 1] - S[i] for i in range(M + 1)] if any([x == 1 for x in S]):
    print(0)
    exit() any([x == 1 for x in S]) any [x == 1 for x in S] print(0) print 0 exit() exit num = 1 num 1 for x in S:
    num *=  fib(x - 1)
    num = num % 1000000007 x S num *=  fib(x - 1) num fib(x - 1) fib x - 1 x 1 num = num % 1000000007 num num % 1000000007 num 1000000007 print(num) print num def mul(a, b):
    return [a[0]*b[0] + a[1]*b[2],
            a[0]*b[1] + a[1]*b[3],
            a[2]*b[0] + a[3]*b[2],
            a[2]*b[1] + a[3]*b[3]]
     def mul(a, b):
    return [a[0]*b[0] + a[1]*b[2],
            a[0]*b[1] + a[1]*b[3],
            a[2]*b[0] + a[3]*b[2],
            a[2]*b[1] + a[3]*b[3]]
     mul M = map(int, input().split()) map(int, input().split()) M num = num % 1000000007 num % 1000000007 num def fib(n):
    if n <= 1:
        return n
    result = [1, 0, 0, 1]
    matrix = [1, 1, 1, 0]
    while n > 0:
        if n % 2:
            result = mul(matrix, result)
        matrix = mul(matrix, matrix)
        n //= 2
    return result[2] def fib(n):
    if n <= 1:
        return n
    result = [1, 0, 0, 1]
    matrix = [1, 1, 1, 0]
    while n > 0:
        if n % 2:
            result = mul(matrix, result)
        matrix = mul(matrix, matrix)
        n //= 2
    return result[2] fib S = [-1] [-1] S N, M = map(int, input().split()) map(int, input().split()) N num = 1 1 num S = [S[i + 1] - S[i] for i in range(M + 1)] [S[i + 1] - S[i] for i in range(M + 1)] S num *=  fib(x - 1) fib(x - 1) num
def fib(n):
    if n <= 1:
        return n
    result = [1, 0, 0, 1]
    matrix = [1, 1, 1, 0]
    while n > 0:
        if n % 2:
            result = mul(matrix, result)
        matrix = mul(matrix, matrix)
        n //= 2
    return result[2]

def mul(a, b):
    return [a[0]*b[0] + a[1]*b[2],
            a[0]*b[1] + a[1]*b[3],
            a[2]*b[0] + a[3]*b[2],
            a[2]*b[1] + a[3]*b[3]]
    
N, M = map(int, input().split())
if N == 1:
    print(1)
    quit()
S = [-1]
for i in range(M):
    S.append(int(input()))
S.append(N + 1)
S = [S[i + 1] - S[i] for i in range(M + 1)]
if any([x == 1 for x in S]):
    print(0)
    exit()
num = 1
for x in S:
    num *=  fib(x - 1)
    num = num % 1000000007
print(num)