#include <bits/stdc++.h>
using namespace std;
constexpr long long int mod = 1000000000 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  if (n == 1) {
    cout << 1 << endl;
  } else {
    vector<long long> v(n + 1, 0), w(m);
    for (int i = 0; i < m; i++) {
      cin >> w[i];
    }
    v[0] = 1;
    int k = 0;
    if (w[0] == 1) {
      k = min(k + 1, m - 1);
    } else {
      v[1] = v[0];
    }
    for (int i = 2; i <= n; i++) {
      if (w[k] == i) {
        k = min(k + 1, m - 1);
      } else {
        v[i] += v[i - 1] + v[i - 2];
        v[i] %= mod;
      }
    }
    cout << v[n] << endl;
  }
}
