using System;
using System.Collections.Generic;
using static System.Math;
using System.Linq;
using System.Text;
 
class DandA {
    static void Main(string[] args) {
        int[] nm = ReadLineIntArray();
        int wk = -1;
        int index = 0;
        long rtn = 0;
        long wk_rtn = 0;
        long wk_up1 = 0;
        long wk_up2 = 0;
        for (int i = 0;i < nm[1];i++) {
            int next = ReadLineInt();
            if (wk == next - 1) {Console.WriteLine(0); return;}
            if (nm[0] == next) {Console.WriteLine(0); return;}
            wk = next;
            wk_rtn = 0;
            for (int j = index;j < next - 1; j++) {
                wk_up2 = wk_up1;
                wk_up1 = wk_rtn;
                if (j == index) {
                    wk_up1 = 1;
                    wk_up2 = 1;
                    wk_rtn = wk_up2;
                } else {
                    wk_rtn = (wk_rtn + wk_up2) % 1000000007;
                }
            }
            if (wk_rtn == 0) { wk_rtn = 1;}
            index = next + 1;
            if (rtn == 0) {
                rtn = wk_rtn % 1000000007;
            } else {
                rtn = (rtn * wk_rtn) % 1000000007;
            }
        }
        wk_rtn = 0;
        wk_up1 = 0;
        wk_up2 = 0;
        for (int j = index;j < nm[0]; j++) {
            wk_up2 = wk_up1;
            wk_up1 = wk_rtn;
            if (j == index) {
                wk_up1 = 1;
                wk_up2 = 1;
                wk_rtn = wk_up2;
            } else {
                wk_rtn = (wk_rtn + wk_up2) % 1000000007;
            }
        }
        if (wk_rtn == 0) { wk_rtn = 1;}
        if (rtn == 0) {
            rtn = wk_rtn % 1000000007;
        } else {
            rtn = (rtn * wk_rtn) % 1000000007;
        }
        Console.WriteLine(rtn);
    }
 
    static string Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ";
    static string[] strAry = new string[] {"L", "R", "U", "D"};
    static int[] intArray = new int[10];
    static List<int> intList = new List<int>();
    static Dictionary<string, int> myTable = new Dictionary<string, int>();
    static HashSet<int>[] rtnArrAb = null;
    static HashSet<int>[] rtnArrCd = null;
  
    static private string ReadLineStr() {return Console.ReadLine();}
    static private int ReadLineInt() {return int.Parse(Console.ReadLine());}
    static private long ReadLineLong() {return long.Parse(Console.ReadLine());}
    static private double ReadLineDouble() {return double.Parse(Console.ReadLine());}
    static private string[] ReadLineStrArray() {return Console.ReadLine().Trim().Split();}
    static private int[] ReadLineIntArray() {return Console.ReadLine().Trim().Split().Select(a => int.Parse(a)).ToArray();}
    static private long[] ReadLineLongArray() {return Console.ReadLine().Trim().Split().Select(a => long.Parse(a)).ToArray();}
    static private double[] ReadLineDoubleArray() {return Console.ReadLine().Trim().Split().Select(a => double.Parse(a)).ToArray();}
    static private decimal[] ReadLineDecimalArray() {return Console.ReadLine().Trim().Split().Select(a => decimal.Parse(a)).ToArray();}
    static private List<int> ReadLineIntList() {return Console.ReadLine().Trim().Split().Select(a => int.Parse(a)).ToList();}
    static private List<long> ReadLineLongList() {return Console.ReadLine().Trim().Split().Select(a => long.Parse(a)).ToList();}
    static private string[][] ReadMLineStrArray(int arg) { return new int[arg].Select(_ => Console.ReadLine().Split()).ToArray();}
    static private int[][] ReadMLineIntArray(int arg) { return new int[arg].Select(_ => Console.ReadLine().Split().Select(int.Parse).ToArray()).ToArray();}
 
    static private bool IsPrime(int num) {
        if (num < 2) return false;
        if (num == 2) return true;
        else if (num % 2 == 0) return false;
        double sqrtNum = Math.Sqrt(num);
        for (int i = 3; i <= sqrtNum; i += 2) {
            if (num % i == 0) return false;
        }
        return true;
    }
  
    static private string IntToNString(int x, int n) {
        var nstring = "";
        var numbers = new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
        int r = 1;
        int q = x;
        while (q > 0) {
            r = q % n;
            nstring += numbers[r];
            q = q / n;
        }
        return string.Join("",nstring.Reverse());
    }
    static private long Gcd(long m,long n){
        long temp;
        while(m % n != 0){
            temp = n;
            n = m % n;
            m = temp;
        }
        return n;
    }
}

Measured memory_bytes: 13524