#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++) 
#define inf 10000000000000;
typedef long long ll;



int main (void){
    ll n,m;
    cin >> n >> m;
    bool b[n+5]={};
    int a;

    rep(i,m){
        cin >> a;
        b[a]=true; 
    }

    ll dp[n+5]={};

    dp[0]=1;
    dp[1]=1;

    for(int i=2;i<=n;i++){
        if(b[i])continue;

        dp[i]=(dp[i-1]+dp[i-2]);
    }

    cout << dp[n]%1000000007 << endl;
   return 0;
}