#include // cout, endl, cin #include // string, to_string, stoi #include // vector #include // min, max, swap, sort, reverse, lower_bound, upper_bound #include // pair, make_pair #include // tuple, make_tuple #include // int64_t, int*_t #include // printf #include // map #include // queue, priority_queue #include // set #include // stack #include // deque #include // unordered_map #include // unordered_set #include // bitset #include // isupper, islower, isdigit, toupper, tolower using std::cin; using std::cout; #define endl "\n" using std::vector; constexpr int mod=1e9+7; int main(){ std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int N; cin>>N; vector dp(N); dp[0]=1; vector A(N); for(int i=0;i>A[i]; if(i>0&&A[i-1]>1){ dp[i]+=dp[i-1]; if(dp[i]>=mod) dp[i]-=mod; } for(int j=i+A[i];j=mod) dp[j]-=mod; } } cout<