#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int main() {
  int n, m;
  cin >> n >> m;
  vector<ll> dp(n + 1, 0);
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  int index = 0;
  if (a[index] != 1) {
    dp[1] = 1;
  } else {
    index++;
  }
  if (a[index] != 2) {
    dp[2] = 1 + dp[1];
  } else {
    index++;
  }
  ll mod = 1000000007;
  for (int i = 3; i <= n; i++) {
    if (i != a[index]) {
      dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
    } else {
      index++;
    }
  }
  cout << dp[n] << endl;
}
