#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];
  vector<int> dp(n + 1, 0);
  dp[0] = 1;
  dp[1] = 1;
  int now = 0;
  if (a[now] == 1) {
    dp[1] = 0;
    now++;
  }
  for (int i = 2; i <= n; ++i) {
    if (i != a[now]) {
      dp[i] = dp[i - 2] + dp[i - 1];
      dp[i] %= (int)1e9 + 7;
    } else
      now++;
  }
  cout << dp[n] << endl;
}
