#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  long n, m;
  long mod = 1e9 + 7;
  cin >> n >> m;
  long long dp[n];
  auto a = vector<long long>(m);
  for (int i = 0; (i) < (int)(m); i++) {
    cin >> a[i];
    dp[a[i]] = 0;
  }
  long j = 0;
  dp[0] = 1;
  if (a[0] == 1) {
    dp[1] = 0;
    j++;
  } else
    dp[1] = 1;
  for (int i = (int)(2); (i) <= (int)(n); i++) {
    if (i == a[j]) {
      if (j < m - 1) j++;
      continue;
    }
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  long res = dp[n] % mod;
  cout << res << endl;
}
