using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AtCoder
{
	public class Program
	{
		static void Main(string[] args)
		{
			const int x = 1000000007;

			int[] vs = Console.ReadLine().Split().Select(p => int.Parse(p)).ToArray();
			int N = vs[0];
			int M = vs[1];

			int[,] pt = new int[N + 1, 2];
			pt[0, 0] = 0;
			pt[0, 1] = 1;
			pt[1, 0] = 1;
			pt[1, 1] = 0;
			pt[2, 0] = 1;
			pt[2, 1] = 1;
			for (int i = 3; i <= N; i++) {
				pt[i, 0] = (pt[i - 1, 0] + pt[i - 1, 1]) % x;
				pt[i, 1] = pt[i - 1, 0];
			}

			int pos = 0, mv = 0;
			long ans = 1;
			for (int i = 0; i < M; i++) {
				int a = int.Parse(Console.ReadLine());
				if (a == pos) {
					Console.WriteLine(0);
					return;
				}
				mv = a - 1 - pos;
				ans = ans * (pt[mv, 0] + pt[mv, 1]) % x;
				pos = a + 1;
			}
			mv = N - pos;
			ans = ans * (pt[mv, 0] + pt[mv, 1]) % x;

			Console.WriteLine(ans);
		}
	}
}
