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