#include <bits/stdc++.h>
using namespace std;
bool mark[100005];
vector<long long> adj[100005];
long long counter;
vector<long long> cnt;
vector<string> forsubs;
long long ans = 1000000000000;
long long n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m, b;
  long long a[100005];
  set<long long> s1;
  long long mod = 1000000007;
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) {
    cin >> b;
    s1.insert(b);
  }
  a[0] = 1;
  if (s1.find(1) != s1.end())
    a[1] = 0;
  else
    a[1] = 1;
  for (long long i = 2; i <= n; i++) {
    if (s1.find(i) != s1.end())
      continue;
    else
      a[i] = a[i - 1] + a[i - 2];
    if (a[i] >= mod) a[i] = a[i] % mod;
  }
  cout << a[n] % mod << endl;
}
