#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> //__gnu_pbds::gp_hash_table<int, int> table;
//priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;  //min heap

typedef int OwO;
typedef double UwU;

#define int long long
#define double long double
#define INF 1000000000
#define PI 3.14159265358979323846
#define watch(x) cout << (#x) << " is " << (x) << endl
#define pii pair<int, int>
#define vpii vector<pair<int, int>>
#define vvi vector<vector<int>>
#define vi vector<int>

using namespace std;

OwO main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int N, M;
  cin >> N >> M;
  vi a(N+1);
  for(int x = 0; x<M; x++){
    int t;
    cin >> t;
    a[t]=1;
  }
  vi memo(N+1);
  memo[0] = 1;
  for(int x = 1; x<=N; x++){
    if(a[x]==1){
      memo[x]=0;
      continue;
    }
    if(x-1>-1 && memo[x-1])
      memo[x]+=memo[x-1];
    if(x-2>-1 && memo[x-2])
      memo[x]+=memo[x-2];
  }
  cout << memo[N]%1000000007 << endl;
  return 0;
}