#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  loop(i,0,n)
#define all(c) c.begin(),c.end()
#define rall(c) c.rbegin(),c.rend()
#define vi vector<int>
#define vl vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>

int fib_memo[100000];
int fib(int n) {
    int i;
    fib_memo[0] = 0;
    fib_memo[1] = 1;
    for(i = 2; i <= n; ++i) {
        fib_memo[i] = fib_memo[i-1] + fib_memo[i-2];
    }
    return fib_memo[n];
}


int main(){
    int n,m;
    cin>>n>>m;
    int a[m];
    int st[n+1]={};
    int f=0;
    ll int con=1000000007;
    ll int ans=0;
    rep(i,n)st[i]=1; 
    st[n]=0;
    rep(i,m){
        cin>>a[i];
        st[a[i]]=0;
        if(a[i]+1-1<n)st[a[i]+1]=0;
        st[a[i]-1]=0;
        if(i>0&&a[i]==a[i-1]+1)f=1;
    }


    if(f==1)cout<<0<<endl;
    else{
        ll int t1;
        ll int t2;
        ll int cnt=0;
        rep(i,n+1){
          
            if(st[i]==1)cnt++;
            else{
                if(cnt!=1)ans+=fib(cnt+1)%con;
              //cout<<fib(cnt+1)<<endl;
                cnt=1;
            }
        }
        //ll int bb=ans%con;
        cout<<ans<<endl;
    }
}