#include <bits/stdc++.h>
#define Rep(i,n,m) for(int i=(int)(n);i<(int)(m);i++)
#define rep(i,n) Rep(i,0,n)
#define all(v) v.begin(),v.end()
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
#define _GLIBCXX_DEBUG

int main(){
  int N;cin>>N;
  vector<int> a(N); rep(i,N) cin >> a[i];
  sort(all(a));
  bool test=true;
  rep(i,N){
    if(a[i]==i+1) continue;
    else test=false;
  }
  if(test) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}
#include<bits/stdc++.h>
using namespace std;

int main(){
  string s, t, tmp;
  cin >> s;
  bool flag = false;
  for(int i = 0; i < (int)s.size(); ++i){
    if(s[i] == 'R'){flag = !flag;}
    else if(s[i] != 'R' && flag == false){t += s[i];}
    else{t.insert(0, {s[i]});}    
  }
  if(flag == true){reverse(t.begin(), t.end());}
  
  stack<char> stk;
  if(t.size() == 0){cout << endl; return(0);}
  for(int i = 0; i < t.size(); ++i){
    if(stk.empty() || stk.top() != t[i]){stk.push(t[i]);}
    else{stk.pop();}
  }
  
  char w;
  string ans;
  int loopnum = stk.size();
  for(int i = 0; i < loopnum; ++i){
     w = stk.top(); stk.pop(); ans += w;
  }
  reverse(ans.begin(), ans.end());
  cout << ans << endl;
}