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

class Program {
    static void Main() {
        int[] input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        int n = input[0], m = input[1];
        int[] a = new int[m], b = new int[m + 1];
        for(int i = 0; i < m; i++) a[i] = int.Parse(Console.ReadLine());
        b[0] = a[0];
        for(int i = 1; i < m; i++) b[i] = a[i] - a[i - 1] - 1;
        b[m] = n - a[m - 1];
        ModInt pro = 1;
        for(int i = 0; i < m + 1; i++) pro *= ModInt.Fib(b[i]);
        Console.WriteLine((int) pro);
    }
}

struct ModInt {
    const int MOD = 1000000007;
    long value;
    
    static List<ModInt> fib = new List<ModInt> { 0, 1 };

    public ModInt(long value) { this.value = value; }
    public static implicit operator ModInt(long a) => new ModInt(a % MOD + (a < 0 ? MOD : 0));
    public static explicit operator int(ModInt a) => (int) a.value;
    public static ModInt operator +(ModInt a, ModInt b) => a.value + b.value;
    public static ModInt operator *(ModInt a, ModInt b) => a.value * b.value;
    public static ModInt Fib(int n) {
        for(int i = fib.Count(); i <= n; i++) fib.Add(fib[i - 2] + fib[i - 1]);
        return fib[n];
    }
}