#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> dp(n, 0ll);
  int ti = 0;
  if (a[ti] != 0)
    dp[0] = 1ll;
  else {
    while (a[ti] == 0) ++ti;
  }
  if (a[ti] != 1)
    dp[1] = 1ll + dp[0];
  else {
    while (a[ti] == 1) ++ti;
  }
  for (int i = 2; i < n; ++i) {
    if (a[ti] != i)
      dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
    else {
      while (ti < m - 1 && a[ti] == i) ++ti;
    }
  }
  cout << dp[n - 1] << endl;
  return 0;
}
