import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

N, M = rl()
A = [-1]
prev_a = -float('inf')
for i in range(M):
	a = ri()
	if a-prev_a == 1:
		print(0)
		exit()
	A.append(a)
	prev_a = a
A.append(N+1)

dp = [0]*(N+5)
dp[0] = 0
dp[1] = 1
for i in range(N+5-2):
	dp[i+2] = dp[i+1] + dp[i]
ans = 1
for i in range(len(A)-1):
	ans *= dp[A[i+1]-A[i]-1]
	ans = ans % mod
print(ans) import sys, math sys math from collections import defaultdict, deque, Counter from bisect import bisect_left, bisect_right from itertools import combinations, permutations, product from heapq import heappush, heappop from functools import lru_cache input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline rs = lambda: input().strip() rs lambda: input().strip() input().strip() ().strip () input strip ri = lambda: int(input()) ri lambda: int(input()) int(input()) int input() input rl = lambda: list(map(int, input().split())) rl lambda: list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split mod = 1000000007 mod 1000000007 sys.setrecursionlimit(1000000) sys.setrecursionlimit sys setrecursionlimit 1000000 N, M = rl() N rl() rl M A = [-1] A [-1] -1 prev_a = -float('inf') prev_a -float('inf') float('inf') float 'inf' for i in range(M):
	a = ri()
	if a-prev_a == 1:
		print(0)
		exit()
	A.append(a)
	prev_a = a i range(M) range M a = ri() a ri() ri if a-prev_a == 1:
		print(0)
		exit()
	 a-prev_a == 1 a-prev_a a prev_a 1 print(0) print 0 exit() exit A.append(a) A.append A append a prev_a = a prev_a a A.append(N+1) A.append A append N+1 N 1 dp = [0]*(N+5) dp [0]*(N+5) [0] 0 N+5 N 5 dp[0] = 0 dp[0] dp 0 0 dp[1] = 1 dp[1] dp 1 1 for i in range(N+5-2):
	dp[i+2] = dp[i+1] + dp[i] i range(N+5-2) range N+5-2 N+5 N 5 2 dp[i+2] = dp[i+1] + dp[i] dp[i+2] dp i+2 i 2 dp[i+1] + dp[i] dp[i+1] dp i+1 i 1 dp[i] dp i ans = 1 ans 1 for i in range(len(A)-1):
	ans *= dp[A[i+1]-A[i]-1]
	ans = ans % mod i range(len(A)-1) range len(A)-1 len(A) len A 1 ans *= dp[A[i+1]-A[i]-1] ans dp[A[i+1]-A[i]-1] dp A[i+1]-A[i]-1 A[i+1]-A[i] A[i+1] A i+1 i 1 A[i] A i 1 ans = ans % mod ans ans % mod ans mod print(ans) print ans N, M = rl() rl() N ans = ans % mod ans % mod ans M = rl() rl() M prev_a = a a prev_a mod = 1000000007 1000000007 mod dp = [0]*(N+5) [0]*(N+5) dp a = ri() ri() a ans *= dp[A[i+1]-A[i]-1] dp[A[i+1]-A[i]-1] ans rs = lambda: input().strip() lambda: input().strip() rs A = [-1] [-1] A ri = lambda: int(input()) lambda: int(input()) ri prev_a = -float('inf') -float('inf') prev_a input = sys.stdin.readline sys.stdin.readline input rl = lambda: list(map(int, input().split())) lambda: list(map(int, input().split())) rl ans = 1 1 ans
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

N, M = rl()
A = [-1]
prev_a = -float('inf')
for i in range(M):
	a = ri()
	if a-prev_a == 1:
		print(0)
		exit()
	A.append(a)
	prev_a = a
A.append(N+1)

dp = [0]*(N+5)
dp[0] = 0
dp[1] = 1
for i in range(N+5-2):
	dp[i+2] = dp[i+1] + dp[i]
ans = 1
for i in range(len(A)-1):
	ans *= dp[A[i+1]-A[i]-1]
	ans = ans % mod
print(ans)
