#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000;
const long long MOD = (long long)1e9 + 7;
signed main() {
  long long n, m;
  cin >> n >> m;
  map<long long, long long> a;
  for (long long i = 0; i < m; i++) {
    long long x;
    cin >> x;
    a[x]++;
  }
  vector<long long> v;
  v.push_back(1);
  v.push_back(1);
  for (long long i = 2; i < n + 1; i++) {
    if (a[i - 1] && a[i - 2]) {
      cout << 0 << "\n";
      return 0;
    } else if (a[i - 1])
      v.push_back(v[i - 2]);
    else if (a[i - 2])
      v.push_back(v[i - 1]);
    else
      v.push_back(v[i - 1] + v[i - 2]);
  }
  cout << v[n] % MOD << "\n";
}
