#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1000000007;
int n;
bool ng[100001];
int dp[100001];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int k;
    cin >> k;
    ng[k] = true;
  }
  dp[0] = 1;
  for (int i = 1; i <= n; ++i) {
    if (ng[i]) continue;
    dp[i] += dp[i - 1];
    if (i >= 2) dp[i] += dp[i - 2];
    if (dp[i] >= MOD) dp[i] -= MOD;
  }
  cout << dp[n] << endl;
}
