#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
using ll = long long;
int main(){ 
    ll n,m;
    cin>>n>>m;
    vector<ll> a(m);
    rep(i,m) cin>>a[i];
    ll b[100010];
    b[0]=1;
    b[1]=1;
    for(int i=2;i<100010;i++){
        b[i]=b[i-1]+b[i-2];
    }
    rep(i,m-1){
        if(a[i+1]-a[i]==1){
            cout<<0;
            return 0;
        }
    }
    ll c=b[a[0]-1];
    c=c%1000000007;
    c=c*b[n-a[m-1]-1]
    c=c%1000000007;
    for(int i=1;i<m;i++){
       c=c*(b[a[i]-a[i-1]-2]);
       c%=1000000007;
    }
    cout<<c;
    return 0;
}
