#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int m;
  cin >> m;
  vector<long long> dp(n, 0), a(m);
  dp[0] = 1;
  long long def = pow(10, 9) + 7;
  for (auto& x : a) {
    cin >> x;
  }
  int mi = 0;
  while (a[mi] < 1) {
    mi++;
    if (mi == m - 1) break;
  }
  if (a[mi] != 1) {
    dp[1] = 1;
  }
  for (int i = 2; i < n; i++) {
    while (a[mi] < i) {
      if (mi == m - 1) break;
      mi++;
    }
    if (a[mi] != i) {
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= def;
    }
  }
  cout << (dp[n - 1] + dp[n - 2]) % def << endl;
  return 0;
}
