#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <unordered_set>
using namespace std;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _rep(i, n) _rep2(i, 0, n)
#define _rep2(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(...) GET_MACRO(__VA_ARGS__, _rep2, _rep)(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using i64 = long long;
template<class T, class U>
bool chmin(T& a, const U& b) { return (b < a) ? (a = b, true) : false; }
template<class T, class U>
bool chmax(T& a, const U& b) { return (b > a) ? (a = b, true) : false; }

template<typename T>istream& operator>>(istream&i,vector<T>&v){rep(j,v.size())i>>v[j];return i;}
template<typename T>string join(vector<T>&v){stringstream s;rep(i,v.size())s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,vector<T>&v){if(v.size())o<<join(v);return o;}
template<typename T>string join(vector<vector<T>>&vv){string s="\n";rep(i,vv.size())s+=join(vv[i])+"\n";return s;}
template<typename T>ostream& operator<<(ostream&o,vector<vector<T>>&vv){if(vv.size())o<<join(vv);return o;}

int main()
{
    string s;
    cin >> s;
    deque<char> que;
    int f = 1;
    int n = s.size();
    rep(i, n)
    {
        if (s[i] == 'R') f = !f;
        else
        {
            if (f)
            {
                if (que.size() && que.back() == s[i]) que.pop_back();
                else que.push_back(s[i]);
            }
            else
            {
                if (que.size() && que.front() == s[i]) que.pop_front();
                else que.push_front(s[i]);
            }
        }
    }
    int m = que.size();
    string ans = "";
    rep(i, m) ans += que[i];
    if (!f) reverse(all(ans));
    cout << ans << endl;
}
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
using std::cout; using std::endl;
using std::string; using std::reverse;


// 自己テンプレート
typedef long long ll;

// 比較して上書きマクロ
template<class T> inline void chmin(T& a, T b) { if(a>b) {a=b;} }
template<class T> inline void chmax(T& a, T b) { if(a<b) {a=b;} }

// dpリソース
const ll INF = 1LL << 60;
ll dp[100010];

int main() {
    int N; cin >> N;
    string str;
    str = to_string(N);
    string rev = str;
    std::reverse(rev.begin(), rev.end());
    
    if (str == rev) {
      cout << "Yes" << endl;
      return 0;
    }
    for (int i = 0; i < 9; i++) {
      str.insert(0, "0");
      rev.append("0");
      if (str == rev) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  
    cout << "No" << endl;
    return 0;
    
}