// Always remember that you are absolutely unique, just like everyone else!

#include <iostream>
#include <vector>
using namespace std;


// DEBUGGING SECTION
void __print(int x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}


#define fastio  ios_base::sync_with_stdio(false);cin.tie(NULL)
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)


#define MOD     1000000007
#define INF     3e18
#define pb      push_back
#define endl    '\n' // Remove if interactive
#define ff      first
#define ss      second
#define FOR(i, a, b)   for(int i = a; i < b; i++)


#include <algorithm>
//#include <cstring>
//#include <map>
//#include <set>
//#include <queue>
#include <stack>
//#include <math.h>

//#include <bits/stdc++.h>

#define int     long long
#define pii     pair<int, int>
#define vi      vector<int>
#define vvi     vector<vi>
#define vpii    vector<pii>
#define all(x)  x.begin(), x.end()

int power(int x, int y) {
	int ans = 1; x %= MOD;
	while (y) {
		if (y & 1)
			ans = (x * ans) % MOD;
		x = (x * x) % MOD;
		y >>= 1;
	}
	return ans;
}




// comparator(A, B) -> should return true if A needs to come before B!
// ALWAYS RETURN FALSE IF A == B

// USE INTEGERS TO REDUCE RUNTIME!



void solve() {
	string s;
	cin >> s;


	int n = s.size();
	string str = "";
	int act = 0;
	for (int i = 0; i < n; i++) {
		if (i == 0 && s[i] == 'R')
			continue;
		if (i < n && (s[i] == 'R' && s[i + 1] == 'R')) {
			i++;
			continue;
		}
		str.push_back(s[i]);
		if (s[i] != 'R')
			act++;
	}
	string t(act, '?');
	int si = 0;
	int ei = act - 1;
	bool flag = false;
	for (int i = str.size() - 1; i >= 0; i--) {
		if (str[i] == 'R') {
			flag ^= true;
		} else {
			if (flag)
				t[si++] = str[i];
			else
				t[ei--] = str[i];
		}
	}
	//debug(str);
	//debug(t);

	stack<char> st;
	for (char& c : t) {
		if (!st.empty() && st.top() == c) {
			st.pop();
		} else {
			st.push(c);
		}
	}
	string op = "";
	while (!st.empty()) {
		op.push_back(st.top());
		st.pop();
	}
	reverse(all(op));
	cout << op << endl;
}



int32_t main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	// freopen("error.txt", "w", stderr);
	freopen("output.txt", "w", stdout);
#endif

	fastio;
	int t = 1;
	//cin >> t;
	while (t--) {
		solve();
	}
}

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using vi = vector<int>;
using vll = vector<long long>;

void solve() {
    string s;
    cin >> s;

    int n = s.size();

    for (int i = 0; i < n; i += 2) {
        if (s[i] < 'a' || s[i] > 'z') {
            cout << "No";
            return;
        }
    }

    for (int i = 1; i < n; i += 2) {
        if (s[i] < 'A' || s[i] > 'Z') {
            cout << "No";
            return;
        }
    }

    cout << "Yes";
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int t = 1;
    // cin >> t;

    while (t--) {
        solve();
    }

    return 0;
}