#include  <iostream>
#include  <stdio.h>
#include <algorithm>
using namespace std;
#include <vector>
#define rep(i,n) for (int i = 0; i < (n) ; i++)
typedef long long ll;
//#include <stack>
//#include <queue>

int standerd = 1000000007;
string ans_Yes = "Yes"; 
string ans_No = "No"; 
string ans_yes = "yes"; 
string ans_no = "no"; 
 
ll cnt;

ll calccnt(ll cnt){
    if(cnt==1) return 1;
    else if (cnt==0) return 1;
    else return ( calccnt(cnt-1) + calccnt(cnt-2) ) % standerd;;
}

int main(){

    int N,M;
    cin >> N;
    cin >> M;

    if(M>0){
        int a[M];
        rep(mi,M) cin >> a[mi];

    }


    ll ans = 1;

    int mi;
    mi = 0;
    cnt = 0;
    int ni=0;
    if(M==0){
        ans = ( ans * calccnt(cnt) ) % standerd;
        cout << ans << endl;
    }else{
        if(a[mi]==1){
            ni=2;
            mi++;
        }
        while(ni <= N){
            if(ni==a[mi]){
                //cout << "mi: " << mi << " cnt: " << cnt << " ans:" << ans << endl;
                ans = ( ans * calccnt(cnt-1) ) % standerd;
                mi++;
                cnt=0;
            }else{
                cnt++;
            }
            ni++;
        }
        ans = ( ans * calccnt(cnt-1) ) % standerd;
        cout << ans << endl;

    }
}