from itertools import product

def mat2_mul(X, Y):
	z = [[0, 0], [0, 0]]
	for (i, j, k) in product(range(2), range(2), range(2)):
		z[i][j] += X[i][k] * Y[k][j]
	return z

def mat2_pow(X, n):
	if n == 0:
		return [[1, 0], [0, 1]]
	elif n % 2:
		return mat2_mul(X, mat2_pow(X, n - 1))
	else:
		half_pow = mat2_pow(X, n / 2)
		return mat2_mul(half_pow, half_pow)

def fibona(n):
	if n == 0:
		return 0
	else:
		f = [[0, 1], [1, 1]]
	return mat2_pow(f, n - 1)[1][1]

def main():
    n, m = map(int,input().split())
    mlis = []
    for _ in range(m):
        a = int(input())
        mlis.append(a)
    ans = 1
    mae = 0

    infi = 10 ** 9 + 7
    for num in mlis:
        ans *= fibona(num-mae)
        ans %= infi
        mae = num + 1

    nobori = n - mae + 1
    ans *= fibona(nobori) 
    ans %= infi
    print(int(ans))
    



if __name__ == "__main__":
    main() from itertools import product def mat2_mul(X, Y):
	z = [[0, 0], [0, 0]]
	for (i, j, k) in product(range(2), range(2), range(2)):
		z[i][j] += X[i][k] * Y[k][j]
	return z mat2_mul z = [[0, 0], [0, 0]] z [[0, 0], [0, 0]] [0, 0] 0 0 [0, 0] 0 0 for (i, j, k) in product(range(2), range(2), range(2)):
		z[i][j] += X[i][k] * Y[k][j]
	 (i, j, k) i j k product(range(2), range(2), range(2)) product range(2) range 2 range(2) range 2 range(2) range 2 z[i][j] += X[i][k] * Y[k][j] z[i][j] [i] z i j X[i][k] * Y[k][j] X[i][k] [i] X i k Y[k][j] [k] Y k j return z z X X Y Y def mat2_pow(X, n):
	if n == 0:
		return [[1, 0], [0, 1]]
	elif n % 2:
		return mat2_mul(X, mat2_pow(X, n - 1))
	else:
		half_pow = mat2_pow(X, n / 2)
		return mat2_mul(half_pow, half_pow) mat2_pow if n == 0:
		return [[1, 0], [0, 1]]
	elif n % 2:
		return mat2_mul(X, mat2_pow(X, n - 1))
	else:
		half_pow = mat2_pow(X, n / 2)
		return mat2_mul(half_pow, half_pow) n == 0 n 0 return [[1, 0], [0, 1]] [[1, 0], [0, 1]] [1, 0] 1 0 [0, 1] 0 1 elif n % 2:
		return mat2_mul(X, mat2_pow(X, n - 1))
	 n % 2 n 2 return mat2_mul(X, mat2_pow(X, n - 1)) mat2_mul(X, mat2_pow(X, n - 1)) mat2_mul X mat2_pow(X, n - 1) mat2_pow X n - 1 n 1 half_pow = mat2_pow(X, n / 2) half_pow mat2_pow(X, n / 2) mat2_pow X n / 2 n 2 return mat2_mul(half_pow, half_pow) mat2_mul(half_pow, half_pow) mat2_mul half_pow half_pow X X n n def fibona(n):
	if n == 0:
		return 0
	else:
		f = [[0, 1], [1, 1]]
	return mat2_pow(f, n - 1)[1][1] fibona if n == 0:
		return 0
	else:
		f = [[0, 1], [1, 1]]
	 n == 0 n 0 return 0 0 f = [[0, 1], [1, 1]] f [[0, 1], [1, 1]] [0, 1] 0 1 [1, 1] 1 1 return mat2_pow(f, n - 1)[1][1] mat2_pow(f, n - 1)[1][1] [1] (f, n - 1) mat2_pow f n - 1 n 1 1 1 n n def main():
    n, m = map(int,input().split())
    mlis = []
    for _ in range(m):
        a = int(input())
        mlis.append(a)
    ans = 1
    mae = 0

    infi = 10 ** 9 + 7
    for num in mlis:
        ans *= fibona(num-mae)
        ans %= infi
        mae = num + 1

    nobori = n - mae + 1
    ans *= fibona(nobori) 
    ans %= infi
    print(int(ans))
     main n, m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m mlis = [] mlis [] for _ in range(m):
        a = int(input())
        mlis.append(a)
     _ range(m) range m a = int(input()) a int(input()) int input() input mlis.append(a) mlis.append mlis append a ans = 1 ans 1 mae = 0 mae 0 infi = 10 ** 9 + 7 infi 10 ** 9 + 7 10 ** 9 10 9 7 for num in mlis:
        ans *= fibona(num-mae)
        ans %= infi
        mae = num + 1

     num mlis ans *= fibona(num-mae) ans fibona(num-mae) fibona num-mae num mae ans %= infi ans infi mae = num + 1 mae num + 1 num 1 nobori = n - mae + 1 nobori n - mae + 1 n - mae n mae 1 ans *= fibona(nobori) ans fibona(nobori) fibona nobori ans %= infi ans infi print(int(ans)) print int(ans) int ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n, m = map(int,input().split())
    mlis = []
    for _ in range(m):
        a = int(input())
        mlis.append(a)
    ans = 1
    mae = 0

    infi = 10 ** 9 + 7
    for num in mlis:
        ans *= fibona(num-mae)
        ans %= infi
        mae = num + 1

    nobori = n - mae + 1
    ans *= fibona(nobori) 
    ans %= infi
    print(int(ans))
     def main():
    n, m = map(int,input().split())
    mlis = []
    for _ in range(m):
        a = int(input())
        mlis.append(a)
    ans = 1
    mae = 0

    infi = 10 ** 9 + 7
    for num in mlis:
        ans *= fibona(num-mae)
        ans %= infi
        mae = num + 1

    nobori = n - mae + 1
    ans *= fibona(nobori) 
    ans %= infi
    print(int(ans))
     main def fibona(n):
	if n == 0:
		return 0
	else:
		f = [[0, 1], [1, 1]]
	return mat2_pow(f, n - 1)[1][1] def fibona(n):
	if n == 0:
		return 0
	else:
		f = [[0, 1], [1, 1]]
	return mat2_pow(f, n - 1)[1][1] fibona def mat2_pow(X, n):
	if n == 0:
		return [[1, 0], [0, 1]]
	elif n % 2:
		return mat2_mul(X, mat2_pow(X, n - 1))
	else:
		half_pow = mat2_pow(X, n / 2)
		return mat2_mul(half_pow, half_pow) def mat2_pow(X, n):
	if n == 0:
		return [[1, 0], [0, 1]]
	elif n % 2:
		return mat2_mul(X, mat2_pow(X, n - 1))
	else:
		half_pow = mat2_pow(X, n / 2)
		return mat2_mul(half_pow, half_pow) mat2_pow def mat2_mul(X, Y):
	z = [[0, 0], [0, 0]]
	for (i, j, k) in product(range(2), range(2), range(2)):
		z[i][j] += X[i][k] * Y[k][j]
	return z def mat2_mul(X, Y):
	z = [[0, 0], [0, 0]]
	for (i, j, k) in product(range(2), range(2), range(2)):
		z[i][j] += X[i][k] * Y[k][j]
	return z mat2_mul
from itertools import product

def mat2_mul(X, Y):
	z = [[0, 0], [0, 0]]
	for (i, j, k) in product(range(2), range(2), range(2)):
		z[i][j] += X[i][k] * Y[k][j]
	return z

def mat2_pow(X, n):
	if n == 0:
		return [[1, 0], [0, 1]]
	elif n % 2:
		return mat2_mul(X, mat2_pow(X, n - 1))
	else:
		half_pow = mat2_pow(X, n / 2)
		return mat2_mul(half_pow, half_pow)

def fibona(n):
	if n == 0:
		return 0
	else:
		f = [[0, 1], [1, 1]]
	return mat2_pow(f, n - 1)[1][1]

def main():
    n, m = map(int,input().split())
    mlis = []
    for _ in range(m):
        a = int(input())
        mlis.append(a)
    ans = 1
    mae = 0

    infi = 10 ** 9 + 7
    for num in mlis:
        ans *= fibona(num-mae)
        ans %= infi
        mae = num + 1

    nobori = n - mae + 1
    ans *= fibona(nobori) 
    ans %= infi
    print(int(ans))
    



if __name__ == "__main__":
    main()