#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()
ll mod = 1000000007;
ll INF = 1000000099;
 
signed main(){
    ll n,m,x=-1,y=-1,ans=1;
    cin>>n>>m;
    vector<ll> fib(n+1),v;
    fib.at(0)=1;
    fib.at(1)=1;
 
    for(ll i=2;i <= n;i++)
    {
        fib.at(i)=fib.at(i-1)%mod+fib.at(i-2)%mod;
        fib.at(i)%=mod;
    }
 
    for(ll i=0;i < m;i++)
    {
        cin>>y;
        if(y==x+1){
            cout << 0 << endl;
            return 0;
        }
        v.pb(y-x-2);
        x=y;
    }
    v.pb(n-y-1);
 
    for(ll i=0;i < (ll)v.size();i++)
    {
        ans*=(fib.at(v.at(i));
        ans%=mod;
    }
    
    cout << ans%mod << endl;
 
}