#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  vector<int> b(n, 1);
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    a.at(i) = x;
    b.at(x - 1) = 0;
  }
  vector<long long> ans(n, 0);
  if (n == 1) {
    cout << 0 << endl;
  }
  if (a.at(0) == 1) {
    if (a.at(1) == 2) {
      cout << 0 << endl;
      return 1;
    } else {
      ans.at(0) = 0;
      ans.at(1) = 1;
    }
  } else if (a.at(0) == 2) {
    ans.at(0) = 1;
    ans.at(1) = 0;
  } else {
    ans.at(0) = 1;
    ans.at(1) = 2;
  }
  for (int i = 2; i < n; i++) {
    if (b.at(i) == 0) {
      ans.at(i) = 0;
    } else {
      ans.at(i) = (ans.at(i - 1) + ans.at(i - 2)) % (1000000007);
    }
  }
  cout << ans.at(n - 1) << endl;
  return 0;
}
