using System;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
class Program
{
	static void Main(string[] args)
	{
		
		var input = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
		int N = input[0];
		int M = input[1];
        
		List<int> a = new List<int>();
		bool ok = true;
		long ans = 0;
		if (M > 0)
		{
			for (var i = 0; i < M; i++)
			{
				a.Add(int.Parse(Console.ReadLine()));
				if (i >= 1 && a[i] - a[i - 1] == 1)
				{
					ok = false;
					break;
				}
			}
		}
		else { ok = false; }

		long[] path = new long[100007];
		path[0] = 0;
		path[1] = 1;
		path[2] = 1;
        for(var i = 3; i < 100007; i++)
		{
			path[i] = path[i - 1] + path[i - 2];
		}
		

		if (ok)
		{
			ans = path[a[0]];
			if (M > 1)
			{
				for (var i = 1; i < M; i++)
				{
					ans = (ans * path[a[i] - a[i - 1] - 1]) % 1000000007;
				}
			}
			ans = (ans * path[N - a[M - 1]])% 1000000007;
		}
		if (M == 0)
		{
			ans = path[N + 1];
		}

		Console.WriteLine(ans);






	}
}
