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