#include <iostream>
#include <vector>
#include <algorithm>

#include <numeric>
using namespace std;

typedef long long ll;

ll dp[1000000];
ll MOD = 1000000007;


int main() {
    int N, M;
    cin>>N>>M;
    
    ll ans;
    bool f = true;
    vector<int> v(M);
    for(int i=0;i<M;i++){
        cin>>v[i];
        if(i>=1 and abs(v[i])-abs(v[i-1])==1){
             ans = 0;
             f = false;
        }
    }
    
    dp[0]=1;
    auto result = std::find(v.begin(), v.end(), 1);
    if (result != v.end()) {
        dp[1] = 0;
    dp[1]=1;

    if(f){
        for(int i=0;i<N;i++){
            auto result = std::find(v.begin(), v.end(), i+1);
            if (result != v.end()) {
                dp[i+1] = 0;
            }
            else{
                dp[i+2] = dp[i+1]+dp[i];
                ans = dp[i+1]%MOD;
            }
        }
    }
    cout<<ans%MOD<<endl;

}
