#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0;i < n;i++)
#define rev(i, n) for(int i = n;i >= 0;i--)
#define Rep(i, m, n) for(int i = m;i < n;i++)
#define repeatrev(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define itn int

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
typedef priority_queue<int> Pr;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll int n, m;
    cin >> n >> m;
    ll int a[m];
    rep(i, m) cin >> a[i];
    ll int dp[n + 1];
    memset(dp, -1, sizeof(dp));
    rep(i, m){
        dp[a[i]] = -2;
    }
    dp[0] = 1;
    if(dp[1] != -2) dp[1] = 1;
	int a;
    rep(i, n - 1){
        if(dp[i + 2] == -1 && dp[i] != -2 && dp[i + 1] != -2){
            dp[i + 2] = dp[i + 1] + dp[i];
        }
        else if(dp[i + 2] == -1 && dp[i] == -2 && dp[i + 1] !=  -2){
            dp[i + 2] = dp[i + 1];
        }
        else if(dp[i + 2] == -1 && dp[i] != -2 && dp[i + 1] == -2){
            dp[i + 2] = dp[i];
        }
        else if(dp[i + 1] == -2 && dp[i] == -2) dp[i + 2] = -2;
      else a = 1;
      dp[i] %= 1000000007;

    }
    if(dp[n] == -1) cout << 0 << endl;
    if(dp[n] == -2) cout << 0 << endl;
     else cout << dp[n] % 1000000007 << endl;

}
