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