#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int ans = 1, di = 1000000007;
  int n, m, flag = 0;
  vector<int> h;
  vector<long long int> v;
  cin >> n >> m;
  v.resize(n);
  h.resize(m);
  for (int i = 0; i < m; i++) cin >> h[i];
  v[0] = 1;
  v[1] = 1;
  v[2] = 1;
  for (int i = 3; i < n; i++) v[i] = (v[i - 2] + v[i - 1]) % di;
  if (m == 0) {
    cout << v[n] << endl;
    return 0;
  }
  ans = v[h[0]];
  for (int i = 1; i < m; i++) {
    if (h[i] - h[i - 1] == 1) {
      cout << "0" << endl;
      return 0;
    }
    ans *= v[h[i] - h[i - 1] - 1];
    ans = ans % di;
  }
  ans *= v[n - h[m - 1]];
  ans = ans % di;
  cout << ans << endl;
}
