#include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; using ull = unsigned long long; const ll inf = 1e9 + 7; int main(){ cin.tie(0); ios::sync_with_stdio(false); //cout << fixed << setprecison(15); int n; cin >> n; vector a(n); for(int i = 0; i < n; i++){ cin >> a[i]; } vector ans; vector s; for(int i = 0; i < n - 1; i++){ if(i == 0){ s.push_back(a[i]); }else{ if(s.back() > a[i]){ s.push_back(a[i]); }else{ ans.push_back(i + 1); } } } for(int i = s.size() - 1; i >= 0; i--){ if(a[n - 1] > s[i]){ ans.push_back(i + 1); }else{ cout << "No" << endl; return 0; } } cout << "Yes" << endl; for(int i = 0; i < ans.size(); i++){ cout << ans[i] << " "; } cout << endl; return 0; }