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