#include <bits/stdc++.h>
#define rep(i,s,n) for (int i=s;i<n;++i)
#define drep(i,s,n) for (int i=n;i>=s;--i)
#define all(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define print(x) cout<<(x)<<endl
using namespace std;
typedef long long ll;
int gcd(int a,int b)
{if (a%b == 0) return(b);
 else          return(gcd(b,a%b));}
int lcm(int a,int b)
{return a*b/gcd(a,b);}
void printv(vector<auto> v) {cout<<'[';rep(i,0,v.size()){cout<<v[i]<<',';}cout<<']'<<endl;}
void printvv(vector<vector<auto>> vv)
{
  cout<<'['<<endl;
  rep(q,0,vv.size()){cout<<'[';rep(p,0,vv.at(q).size())cout<<vv.at(q).at(p)<<',';cout <<']'<<endl;}
  cout<<']'<<endl;
}
void solve(); int main(){cin.tie(0);ios::sync_with_stdio(0);solve();}
int step_x[] = {-1,0,0,1};
int step_y[] = {0,-1,1,0};
const long long INF = 1000000;
//------------------------------------------------------------
int n,m;
void solve()
{
    cin >> n >> m;
    vector<ll> v(m+1);
    vector<ll> dp(n+1);
    rep(i,0,m) {cin >> v[i];}

    dp[0]=1;
    int num=0;

    rep(i,1,n+1)
    {
      // iが1で床がる
      if(i==1&&find(all(v), 1)==v.end())
      {
        dp[1]=1;
      }
      // iは床がある
      else if(i!=v[num])
      {
        dp[i]=dp[i-1]+dp[i-2];
      }
      else{
        dp[i]=0;
        num++;
      }
      dp[n]%=1000000007;
    }

    print(dp[n]);

    return;
}

