#include<iostream>
#include<sstream>
#include<vector>
#include<algorithm>
#include<string>
#include<stdexcept>
#include<stdio.h>
#include<queue>
#include<stack>
#include <cmath>
#include<bits/stdc++.h>
#include<math.h>
#include<iomanip>
#define cinf(n,x) for(int i=0;i<n;i++) cin >> x[i];
#define pi pair<int,int> 
using namespace std;
using ll = long long;

int main(){
    int n,m; cin >> n >> m;
    int a[m]; 
    ll b[n+2]={};
    b[0]=1; b[1]=1;
    for(int i=0;i<m;i++){
        cin >> a[i];
        b[a[i]] = -1;
    }
    for(int i=-1;i<n;i++){
        if(b[i+2] == -1) b[i+2] = 0;
        else if(b[i+1] == -1) b[i+2] = b[i];
        else if(b[i] == -1) b[i+2] = b[i+1];
        else b[i+2] = (b[i+1]+b[i]) % 1000000007;
    }
    cout << b[n] % 1000000007 <<endl;
    return 0;
}