#include using namespace std; using ll = int_fast64_t; #define rep(i,n) for(int i=0;i0;) signed main(){ int n; cin>>n; vector a(n); for(auto& ai:a)cin>>ai; auto solve = [](int n,auto a)->bool{ int plus = 0; for(int i=n;i-->0;){ if(a[i]==0)continue; if(a[i]+plus!=i+1)return false; plus++; } return true; }; cout<<(solve(n,a)?"Yes":"No")<