#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  unordered_set<int> a_i;
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    a_i.insert(a);
  }
  long long s[10001] = {};
  s[0] = 1;
  for (int i = 1; i <= n; i++) {
    if (a_i.find(i) != a_i.end())
      s[i] = 0;
    else {
      if (i > 1) {
        if (a_i.find(i - 1) != a_i.end())
          s[i] = s[i - 2];
        else
          s[i] = s[i - 1] + s[i - 2];
      } else
        s[i] = s[i - 1];
    }
    s[i] = s[i] % mod;
  }
  cout << s[n] << endl;
  return 0;
}
