#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
// #include<C:\Users\J\Desktop\AC\athead.h>
#define showa(v) for(int iii = 0; iii < v.size(); iii++){ cout << v[iii] << " ";} cout << endl;
#define show(iiii) cout << iiii << endl; 
#define shows(iiiii) cout << iiiii << " ";
#define divs 1000000007
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include <cmath>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <set>
#include <deque>
#include <numeric>
#include<tuple>
#include <utility>
#include <map>
using namespace std;

int saiki(int n, vector<int>& memo){
    int res = 0;
    if (memo[n] == -1){
        res += ((saiki(n-1, memo))+(saiki(n-2, memo)));
        return res;
    }
    else{
        return memo[n];
    }
}

int main(){
    int div = divs;
    int n, m;
    cin >> n >> m;
    vector<int> a(m+1);
    int hoji = -5;

    rep(i,m){
        cin >> a[i];
        if(hoji +1 == a[i] && hoji-1 < n){
            cout << 0;
            return 0;
        }
        hoji = a[i];
    }

    a[m] = n+1;
    int prev = 0;

    long long int res = 1;
    vector<int> memo(n+10);
    rep(j,n+10) memo[j] = -1;
    memo[0] = 0;
    memo[1] = 1;

    rep(i,m+1){
        int haba = a[i] - prev;
        res = res%divs*saiki(haba, memo)%divs;
        prev = a[i]+1;
        showa(memo)
    }

    cout << res;
}
