#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> broken(n);
  for (int i = 0; i < (m); i++) {
    int a;
    cin >> a;
    broken[--a] = 1;
  }
  vector<int> p(n);
  p[0] = 1;
  p[1] = 2;
  for (int i = 0; i < (n); i++) {
    if (broken[i]) {
      p[i] = 0;
      continue;
    }
    if (i < 2) {
      continue;
    }
    p[i] = p[i - 1] + p[i - 2];
    p[i] %= mod;
  }
  cout << p[n - 1] << endl;
  return 0;
}
