#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  queue<int> a;
  for (int i = 0; i < (m); ++i) {
    int q;
    cin >> q;
    a.push(q);
  }
  vector<int> dp(n + 1);
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 0; i < (n - 1); ++i) {
    dp[i + 2] = (dp[i + 1] + dp[i]) % MOD;
    if (i + 2 == a.front()) {
      dp[i + 2] = 0;
      a.pop();
    }
  }
  cout << dp[n] % MOD << endl;
  return 0;
}
