#include <iostream>
using namespace std;

int main(){
  int n;
  vector<int> dp(n+2);
  vector<int> broken(n+1);
  
  for (i=1;i<n,i++){
    int a;
    cin >> a;
    broken[a] = 1;
  }
  
  const int mod = 1000000007;
  for (i=n-1;i<=0;i--){
    if (broken[i]){
      dp[i]=0;
      continue;
    }
    dp[i] = dp[i+1]+dp[i+2]%mod;
  }
  cout << dp[0] << endl;
}
  