#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  const int N = 1000000007;
  cin >> n >> m;
  vector<int> v(m);
  for (int i = 0; i < m; ++i) cin >> v[i];
  vector<int> c(n + 1, 0);
  c[0] = 1;
  int r = 0;
  for (int i = 1; i <= n; ++i) {
    if (i != v[r]) {
      if (i - 1 >= 0) {
        c[i] += c[i - 1];
        c[i] %= N;
      }
      if (i - 2 >= 0) {
        c[i] += c[i - 2];
        c[i] %= N;
      }
    } else {
      r++;
    }
  }
  cout << c.back() << endl;
}
