#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> b(n + 5, true);
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    b[a] = false;
  }
  vector<long long> dp(n + 5);
  dp[0] = 1;
  for (int i = 0; i < n + 2; i++) {
    if (b[i]) {
      (dp[i + 1] += dp[i]) %= MOD;
      (dp[i + 2] += dp[i]) %= MOD;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
