#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
void solve() {
  int n, m;
  cin >> n >> m;
  vector<int> v(n);
  for (int i = 0; i < m; i++) cin >> v[i];
  vector<int> dp(n + 1, 0);
  int cur = 0;
  if (v[cur] == 1) {
    cur++;
    dp[2]++;
  } else
    dp[1] = 1;
  if (v[cur] == 2) {
    cur++;
  } else
    dp[2] = dp[1] + 1;
  for (int i = 3; i <= n; i++) {
    if (i == v[cur]) {
      cur++;
      continue;
    }
    dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
  }
  cout << dp[n];
}
int main() {
  int T = 1;
  for (int i = 0; i < T; i++) solve();
}
