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