#include<bits/stdc++.h>

using namespace std;

int main(){
    long long int N,M;
    cin >> N >> M;

    vector<long long int> a(M);
    for(long long int i = 0; i < M; i++) cin >> a[i];
    vector<long long int> dp(N + 1,0);
    dp[0] = 1;
    long long int j = 0;
    if(a[j] == 1){ dp[1] = 0; j++; }
    else{ dp[1] = 1;}
   
   for(long long int i = 2; i <= N; i++){
       
       if(i == a[j] && j < M){ dp[i] = 0; j++; }
       else{ dp[i] = dp[i - 1] + dp[i - 2];
       dp[i] %= 1000000007; } 

       if(i - 1 != a[j]) dp[]
   }

   cout << dp[N] << endl;
    return 0;
}
