#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];
    a[i]--;
  }
  vector<long long> ans(n, 0);
  int c = 0;
  bool b = true;
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      if (a[c] == 0) {
        c++;
        ans[i] = 0;
      } else {
        ans[i] = 1;
      }
    } else if (i == 1) {
      if (a[c] == 1) {
        c++;
        ans[i] = 0;
      } else {
        ans[i] = ans[i - 1] + 1;
      }
    } else {
      if (a[c] == i) {
        c++;
        ans[i] = 0;
      } else {
        ans[i] = ans[i - 1] + ans[i - 2];
        ans[i] %= 1000000007;
      }
    }
  }
  cout << ans[n - 1] << endl;
}
