from functools import lru_cache
2.@lru_cache(maxsize=1000)
3.def fib(n):
4.    if n < 2:
5.        return n
6.    else:
7.        return fib(n - 1) + fib(n - 2)
8. 
9.n,m = map(int,input().split())
10.a = []
11.a.append(0)
12.for i in range(m):
13.    b = int(input())
14.    b -= 1
15.    a.append(b)
16.a.append(n)
17.b = []
18. 
19.for i in range(n):
20.    b.append(fib(i))
21. 
22.c = []
23.#if a[1] == 0:
24.    #c.append(1)
25.#else:
26.    #c.append(b[a[1] - a[0] ])
27.i = 0
28.while i <= m:
29.    #if a[i + 1] - a[i] - 2 >= 0:
30.    c.append(b[a[i + 1] - a[i]  - 2])
31.    i += 1
32.    #elif a[i + 1] - a[i] - 2 == 0:
33.        #c.append(1)
34.    #else:
35.        #c.append(0)
36.        #break
37.#print(c)
38.d = c[0] 
39.i = 1
40.#print(d)
41.while i < len(c):
42.    d = d * c[i]
43.    i += 1
44.e = 1000000007
45.print(d % e)
46.#print(b[0])
