# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
input = sys.stdin.readline
 
# bisect_left(lists, 3)
# bisect_right(lists, 3)

# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

def main():
	N,M = map(int, input().split(" "))
	#N = int(input())
	#S = input()
	#S = list(S)
	
	a = []
	for _ in range(M):
		tmp = int(input())
		if len(a) != 0:
			if tmp-1 == a[-1]:
				print(0)
				sys.exit()
		a.append(tmp)

	if M == 0:
		print(fb(N+1))
		sys.exit()

	base = 0
	ans = []
	for i, vol in enumerate(a):
		if base == 0:
			ans.append(fb(vol))
			base = vol
		else:
			ans.append(fb(vol-base-1)% 1000000007)
			base = vol

	if N != base:
		ans.append(fb(N-base)% 1000000007)

	tmp = 1
	for i in ans:
		tmp = (tmp % 1000000007) * i

	print(tmp % 1000000007)
	#print(ans)


def fb(num):
    """num番目のフィボナッチ数を返す
    """
    a, b = 1, 0
    for _ in range(num):
        a, b = a + b, a
    return b

if __name__ == "__main__":
	main()