#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = (0); i < (m); i++) cin >> a[i];
  vector<long long> dp(n + 1, 0);
  dp[0] = 1;
  if (a[0] != 1) dp[1] = 1;
  int j = 0;
  for (int i = 2; i <= n; i++) {
    while (j < m && a[j] < i) j++;
    if (j >= m || i != a[j]) {
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= MOD;
    }
  }
  cout << dp[n] << endl;
}
