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