#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const ll INF=1LL<<60; typedef pair P; typedef pair PP; const ll MOD=1e9+7; const double PI=acos(-1); int main(){ int N; cin>>N; map> mp; vector A(N); for(int i=0;i>A[i]; mp[A[i]].push_back(i); } vector dp(N+1,0); dp[0]=1; for(int i=1;i=i) break; //v