#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
// #pragma GCC target("avx2")
// 293206GT
#include <array>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <climits>
#include <limits>
#include <set>
#include <map>
#include <queue>
//#include <unordered_map>
//#include <unordered_set>
//#include <unordered_set>
//#include <stack>
#include <string>
#include <algorithm>
#include <random>
#include <bitset>
#include <chrono>
//#include <cstdlib>
//#include <cstring>

// #include <bits/extc++.h>
// using namespace __gnu_pbds;
//template<class T>
//using OrderedSet = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
using ll = long long;
#define int ll
// #define int long long
using namespace std;
#define put(a) cout << (a) << '\n'
#define sqr(x) ((x) * (x))
typedef pair<int, int> pii;
typedef long double ld;
typedef pair<ld, ld> pld;
typedef unsigned long long ull;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
#define ts to_string
#define sts string ts

sts(string s) { return s; }

sts(bool b) { return b ? "true" : "false"; }

sts(char c) { return string(1, c); }

sts(const char *s) { return (string) s; }

template<class A, class B>
sts(pair<A, B>);

template<class T>
sts(T v) {
    string s = "{", sep = "";
    for (auto x : v) {
        s += sep;
        sep = ", ";
        s += ts(x);
    }
    return s + "}";
}

template<class A, class B>
sts(pair<A, B> p) { return "(" + ts(p.first) + ", " + ts(p.second) + ")"; }

void dbgPrint() { cerr << endl; }

template<class A, class... B>
void dbgPrint(A a, B... b) {
    cerr << ' ' << ts(a);
    dbgPrint(b...);
}

#ifdef LOCAL
#define dbg(...) cerr << "line #" << __LINE__ << " [" << #__VA_ARGS__ << "]:", dbgPrint(__VA_ARGS__)
#else
#define dbg(...)
#endif

#define sz(a) (int) (a).size()
#define len(a) (int) (a).size()
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define eb emplace_back
#define rep(x, y, a) for (int x = (y); x < (int)(a); ++x)
#define asd(n) rep(i, 0, n)
#define jkl(n) rep(j, 0, n)
#define UB upper_bound
#define LB lower_bound
#define mp make_pair
namespace IO {

    template<class A, class B>
    ostream &operator<<(ostream &out, vector<pair<A, B>> a);

    template<class A>
    ostream &operator<<(ostream &out, vector<A> a);

    template<class A, class B>
    ostream &operator<<(ostream &out, pair<A, B> a) {
        out << a.first << " " << a.second;
        return out;
    }

    template<class A, class B>
    ostream &operator<<(ostream &out, vector<pair<A, B>> a) {
        for (pair<A, B> x : a)
            out << x.first << " " << x.second << '\n';
        return out;
    }

    template<class A>
    ostream &operator<<(ostream &out, vector<A> a) {
        for (A x : a) out << x << ' ';
        return out;
    }

    template<class A, class B>
    istream &operator>>(istream &in, pair<A, B> &a) {
        in >> a.first >> a.second;
        return in;
    }

    template<class A>
    istream &operator>>(istream &in, vector<A> &a) {
        for (A &x : a) in >> x;
        return in;
    }
}  // namespace IO

template<class A, class B>
inline int chkmax(A &a, B b) {
    if (a < (A) b) {
        a = (A) b;
        return 1;
    }
    return 0;
}

template<class A, class B>
inline int chkmin(A &a, B b) {
    if (a > (A) b) {
        a = (A) b;
        return 1;
    }
    return 0;
}

using namespace IO;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void solve();

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(41);
    int q = 1;
    // cin >> q;
    while (q--) solve();
}

void solve() {
    int n;
    cin >> n;
    vi a(n);
    cin >> a;
    sort(all(a));
    int f = 1;
    asd(n) if (a[i] != i + 1) f = 0;
    if (f) put("Yes");
    else put("No");
}




#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i,s,n) for(int i = s; i < (int)(n); i++)

int main() {
	string s;
	cin >> s;
	deque<char>deq;
	int rc = 0;
	rep(i, 0, s.size()) {
		if (s[i] == 'R') rc++;
		else {
			if (rc % 2 == 0) deq.push_back(s[i]);
			else deq.push_front(s[i]);
		}
	}
	stack<char>st;
	while(!deq.empty()) {
		char v = deq.front();
		deq.pop_front();
		if(!st.empty() && v == st.top()) st.pop();
		else st.push(v);
	}
	string ans;
	while (!st.empty()) {
		char a = st.top();
		ans.push_back(a);
		st.pop();
	}
	if (rc % 2 == 0) reverse(ans.begin(), ans.end());
	cout << ans << endl;
}