from collections import Counter
n, m = map(int, input().split())
l = []
a0 = 0
for i in range(m):
    a = int(input())
    if a - a0 == 0:
        print(0)
        exit()
    l.append(a - a0 - 1)
    a0 = a + 1
l.append(n - a0)
d = Counter(l)
key = list(d.keys())

ma = max(key)
fib = [1]*(ma + 1)
for i in range(2, ma + 1):
    fib[i] = fib[i - 2] + fib[i - 1]

ans = 1
for k in key:
    ans *= fib[k]**d[k]
    ans %= 10**9 + 7

print(ans) from collections import Counter n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m l = [] l [] a0 = 0 a0 0 for i in range(m):
    a = int(input())
    if a - a0 == 0:
        print(0)
        exit()
    l.append(a - a0 - 1)
    a0 = a + 1 i range(m) range m a = int(input()) a int(input()) int input() input if a - a0 == 0:
        print(0)
        exit()
     a - a0 == 0 a - a0 a a0 0 print(0) print 0 exit() exit l.append(a - a0 - 1) l.append l append a - a0 - 1 a - a0 a a0 1 a0 = a + 1 a0 a + 1 a 1 l.append(n - a0) l.append l append n - a0 n a0 d = Counter(l) d Counter(l) Counter l key = list(d.keys()) key list(d.keys()) list d.keys() d.keys d keys ma = max(key) ma max(key) max key fib = [1]*(ma + 1) fib [1]*(ma + 1) [1] 1 ma + 1 ma 1 for i in range(2, ma + 1):
    fib[i] = fib[i - 2] + fib[i - 1] i range(2, ma + 1) range 2 ma + 1 ma 1 fib[i] = fib[i - 2] + fib[i - 1] fib[i] fib i fib[i - 2] + fib[i - 1] fib[i - 2] fib i - 2 i 2 fib[i - 1] fib i - 1 i 1 ans = 1 ans 1 for k in key:
    ans *= fib[k]**d[k]
    ans %= 10**9 + 7 k key ans *= fib[k]**d[k] ans fib[k]**d[k] fib[k] fib k d[k] d k ans %= 10**9 + 7 ans 10**9 + 7 10**9 10 9 7 print(ans) print ans ans = 1 1 ans a0 = 0 0 a0 ans *= fib[k]**d[k] fib[k]**d[k] ans d = Counter(l) Counter(l) d l = [] [] l a = int(input()) int(input()) a ans %= 10**9 + 7 10**9 + 7 ans ma = max(key) max(key) ma a0 = a + 1 a + 1 a0 m = map(int, input().split()) map(int, input().split()) m key = list(d.keys()) list(d.keys()) key fib = [1]*(ma + 1) [1]*(ma + 1) fib n, m = map(int, input().split()) map(int, input().split()) n
from collections import Counter
n, m = map(int, input().split())
l = []
a0 = 0
for i in range(m):
    a = int(input())
    if a - a0 == 0:
        print(0)
        exit()
    l.append(a - a0 - 1)
    a0 = a + 1
l.append(n - a0)
d = Counter(l)
key = list(d.keys())

ma = max(key)
fib = [1]*(ma + 1)
for i in range(2, ma + 1):
    fib[i] = fib[i - 2] + fib[i - 1]

ans = 1
for k in key:
    ans *= fib[k]**d[k]
    ans %= 10**9 + 7

print(ans)