#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

string s;
bool ans = true;
bool flag = true;
int point = 0;

int main()
{
    cin >> s;
    reverse(s.begin(), s.end());
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == '0') {
            continue;
        } else {
            point = i;
            break;
        }
    }


    for (int i = point; i < s.size(); i++) {
        if (s[i] == s[s.size() - 1 - i + point]) {
        } else {
            flag = false;
        }
    }
    if (flag) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}
//kyoprosaikoooooooooooo!!
#include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
using namespace std;
//素数判定 O(√N)
ll prime (ll abc) {
  if (abc < 2) {
    return 0;
  }
  else if (abc == 2) {
    return 1;
  }
  else if (abc % 2 == 0) {
    return 0;
  }
  double sqrtabc = sqrt(abc);
  for (int i = 3; i <= sqrtabc; i++) {
    if (abc % i == 0) {
      return 0;
    }
  }
  return 1;
}
//素因数分解(約数列挙) O(√N)
vector<ll> divisor(ll n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end());
    return ret;
}
//最大公約数
ll gcd(ll x,ll y){
    if(x<y) swap(x,y);
    ll r;
    while(y>0){
        r=x%y;
        x=y;
        y=r;
    }
    return x;
}
//最小公倍数
ll lcm(ll x,ll y){
    return (ll)(x/gcd(x,y))*y;
}
int main() {
  string S;
  cin >> S;
  int sum = 0;
  deque<char> ans;
  if (S.at(0) != 'R') {
    ans.push_back(S.at(0));
  }
  else {
    sum++;
  }
  for (int i = 1; i < (int)S.size(); i++) {
    char a = S.at(i);
    if (a == 'R') {
      sum++;
    }
    else {
      if (sum % 2 == 0) {
        ans.push_back(a);
      }
      else {
          ans.push_front(a);
      }
    }
  }
  if (sum % 2 == 1) {
    reverse(ans.begin(), ans.end());
  }
  string A = "";
  for (char c : ans) {
    if (A.back() == c && A.size()) {
      A.pop_back();
    }
    else {
      A.push_back(c);
    }
  }
  cout << A << endl;
}