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