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


public class Contest
{
	public static void Main()
	{
		int[] a = Array.ConvertAll(Console.ReadLine().Split(' '), new Converter<string,int>(s => int.Parse(s)));

//		int[] b = Array.ConvertAll(Console.ReadLine().Split(' '), new Converter<string,int>(s => int.Parse(s)));
//		int[] c = Array.ConvertAll(Console.ReadLine().Split(' '), new Converter<string,int>(s => int.Parse(s)));
//		int[] d = Array.ConvertAll(Console.ReadLine().Split(' '), new Converter<string,int>(s => int.Parse(s)));
	
		int[] e = new int[a[1]];
		for(int i=0; i<a[1]; i++){
			e[i] = int.Parse(Console.ReadLine());
		}

		for(int i=0; i<a[1]-1; i++) {
			if(e[i]+1==e[i+1]) {
				Console.WriteLine(0);
				return;
			}
		}
		
		int cc =0;
		ulong es = 1;
		for(int i=0; i<a[1]; i++) {
			if(i==0) { cc = e[i]-1; } else { cc = e[i]-e[i-1]-2; }
			es = (es * (fib((ulong)cc)%1000000007)%1000000007); 
		}
		cc = a[0]-e[a[1]-1]-1;
		es = (es * (fib((ulong)cc)%1000000007)%1000000007); 

		Console.WriteLine(es);
	}
	
	private static ulong fib(ulong n) {
      if (n == 0)
          return 1;
      if (n == 1)
          return 1;
      return fib(n - 1) + fib(n - 2);
	}




}
