jiahuimbzuai/CoQuIR huggingface dataset:
//  [swift]
// 🐋💭
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func readInt() -> Int {
    return Int(readLine()!)!
}

func readDoubles () -> [Double] {
    return readLine()!.split(separator: " ").map { Double($0)! }
}

func readDouble() -> Double{
    return Double(readLine()!)!
}

func readLines() -> [String] {
    return readLine()!.map { String($0) }
}
///最大公約数を返す
func gcd(_ m:Int, _ n:Int) -> Int {
    if n == 0 {return m}
    return gcd(n, m % n)
}

///最大公約数を返す
func gcd(_ array: [Int]) -> Int {
    var value = array[0]
    if array.count > 1 {
        for i in 1..<array.count {
            value = gcd(value, array[i])
        }
    }
    return value
}

///最小公倍数を返す
func lcm(_ m:Int, _ n:Int) -> Int {
    return m * n / gcd(m, n)
}

///素数判定(試し割り)
func isPrime(_ x:Int) -> Bool {
    if x <= 1 || x % 2 == 0 { return false }
    if x == 2 { return true }
    for i in stride(from: 3, to: Int(ceil(sqrt(Double(x)))), by: 2){
        if x % i == 0 {
            return false
        }
    }
    return true
}

//https://program-life.com/669
///実行速度の計測
func exectionTime(action: () -> Void) {
    let startDate = Date()
    action()
    let endDate = Date()
    print(endDate.timeIntervalSince(startDate))
}

// https://melheaven.hatenadiary.jp/entry/atcoder144
///約数の配列を返す
func makeDivisors(_ n:Int) -> [Int] {
    var divisors = [Int]()
    for i in 1..<Int(pow(Double(n), 0.5)) + 1 {
        if n % i == 0{
            divisors.append(i + n / i)
        }
    }
    
    return divisors
}

//https://riptutorial.com/ja/swift/example/14738/インデックスを知らずに配列から要素を削除する
extension Array where Element: Equatable {
    
    mutating func remove(_ element: Element) {
        _ = firstIndex(of: element).flatMap {
            self.remove(at: $0)
        }
    }
}

func binarySearch(rifgt:Int, key:Int, ary:[String]) -> Int{
    var left = 0
    var right = rifgt
    
    while abs(right - left) > 1 {
        let mid = left + (right - left) / 2
        
        if Int(ary[mid])! < key {
            left = mid
            
        } else {
            right = mid
        }
    }
    return left
}

func arrangement (prev:String, ary:[String], returnVal:[String]) -> [String] {
    var returnVal = returnVal
    if ary.count == 0 {
        returnVal.append(prev)
        return returnVal
    }
    
    for s in ary {
        let wprev = prev + s
        var wary = ary
        wary.remove(s)
        returnVal = arrangement(prev: wprev, ary: wary, returnVal: returnVal)
    }
    return returnVal
}

func main() {
    let n = readInt()
    var aryA = readInts()
    //＿＿＿＿＿＿＿＿＿＿＿＿＿＿ここまで入力
    aryA.sort(by: >)
    var ans = 0
    for i in 0..<n - 1 {
        ans += aryA[i]
    }
    print(ans)
}
main()
//  [swift]
func readInt() -> Int {
    return Int(readLine()!)!
}

func readInts(separator: String.Element = " ") -> [Int] {
    return readLine()!.split(separator: separator).map { Int($0)! }
}

func mainD() {
    let N = readInt()
    let frendly = readInts().sorted(by: >)

    var point = 0
    var circle: [Int] = []
    circle.append(frendly[0])
    for i in 1..<N {
        var maxPoint = 0
        var maxPointIndex = 0
        for j in 0...i {
            let left = j == 0 ? circle.last! : circle[j - 1]
            let right = j == i ? circle.first! : circle[j]
            let point = min(left, right)

            if maxPoint < point {
                maxPoint = point
                maxPointIndex = j
            }
        }

        circle.insert(frendly[i], at: maxPointIndex)
        point += maxPoint
    }

    print(point)
}

mainD()
//  [typescript]
import { readFileSync } from 'fs'
import { reverse } from 'dns'

function main(input: string[]) {
  let N = Number(input[0])
  let A : number[] = input[1].split(' ').map(v=>parseInt(v, 10))

  A = A.sort((a, b) => a - b)
  A.reverse()
  let ans = A[0]
  N -= 2
  for (let i = 1;; i++) {
    if (N == 0) break;
    if (N == 1) {
      ans += A[i]
      N--
    } else {
      ans += A[i] * 2
      N -= 2
    }
  }

  console.log(ans.toString())
}

let lines: string[] = [];
const reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', function (line: string) {
  lines.push(line);
});
reader.on('close', function () {
  main(lines)
});
//  [typescript]
import { readFileSync } from 'fs'

function main(input: string) {
  const [n, ...players] = input.split(/\s/).map(Number)

  const sum = players.reduce((sum, v) => sum + v, 0)
  const min = Math.min(...players)
  const result = sum - min

  console.log(result)
}

main(readFileSync('/dev/stdin', 'utf8').trim())
//  [typescript]
import { readFileSync } from 'fs'
import { reverse } from 'dns'

function main(input: string[]) {
  let N = Number(input[0])
  let A : number[] = input[1].split(' ').map(v=>parseInt(v, 10))

  A = A.sort((a, b) => a - b)
  A.reverse()
  let ans = A[0]
  N -= 2
  for (let i = 1;; i++) {
    if (N == 1) {
      ans += A[i]
      N--
    } else {
      ans += A[i] * 2
      N -= 2
    }
    if (N == 0) break;
  }

  console.log(ans.toString())
}

let lines: string[] = [];
const reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', function (line: string) {
  lines.push(line);
});
reader.on('close', function () {
  main(lines)
});
//  [typescript]
import * as fs from "fs";
const input = fs.readFileSync("/dev/stdin", "utf8").split("\n");
input.shift();
const members = input[0].split(" ").map(Number);
members.sort((a, b) => b - a);

let sum = 0;
sum = members[0] + members[1];

for (let index = 2; index < members.length - 1; index++) {
  let arr = members.slice(0, index);
  const max = Math.max(...arr);
  arr = arr.filter((item) => item !== max);
  const num = Math.max(...arr);
  sum += num;
}

console.log(sum);
//  [python]
s = list(input())
point = 0
for i in range(len(s)):
  if i % 2 == 0:
    if s[i] == "L":
      point += 1
      break
  else:
    if s[i] == "R":
      point += 1
      break
if point == 0:
  print("Yes")
else:
  print("No")
//  [python]
s = input()
for i in range(len(s)):
    if i%2 == 0:
        if not(s[i] in ['R', 'U', 'D']):
            print('No')
            exit()
    else:
        if not(s[i] in ['L', 'U', 'D']):
            print('No')
            exit()
print('Yes')
//  [python]
S= list(input())
a=[]
for i in range(0,len(S)):
  if i%2==0:
    if S[i]=="R" or S[i] == "U" or S[i]=="D":
      a.append(1)
  elif i%2!=0:
    if S[i]=="L" or S[i]=="U" or S[i]=="D":
      a.append(1)
if len(S)==sum(a):
  print("Yes")
else:
  print("No")
//  [python]
S = input()
SW1 = 0
SW2 = 0

for i in range(0,len(S),2):
    if S[i] == 'L' or S[i] == 'U' or S[i] == 'D':
        SW1 += 1

for i in range(1,len(S),2):
    if S[i] == 'R' or S[i] == 'U' or S[i] == 'D':
        SW2 += 1

if SW1 == len(S)/2 and SW2 == len(S)/2:
    print('Yes')
else:
    print('No')
//  [python]
s=list(input())
even=s[0::2]
odd=s[1::2]
for i in even:
    if i!="L" or i!="U" or i!="D":
        print("No")
        exit()
for i in odd:
    if i!="R" or i!="U" or i!="D":
        print("No")
        exit()
print("Yes")
//  [python]
s=list(input())
even=s[0::2]
odd=s[1::2]
for i in even:
    if i!="L" or "U" or "D":
        print("No")
        exit()
for i in odd:
    if i!="R" or "U" or "D":
        print("No")
        exit()
print("Yes")
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String args[]) {

		FastScanner sc = new FastScanner();
		char n[] = sc.next().toCharArray();

		boolean result = true;
		for (int i = 0; i < n.length; i++) {
			if (n[i] == (((i + 1) % 2 == 0) ? 'R' : 'L')) {
				System.out.println("No");
				return;
			}
		}

		System.out.println("Yes");
	}
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
            return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
		return hasNextByte();
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
            }
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
            }
        }

	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) nl;
        }

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}
//  [java]
import java.io.*;
import java.util.*;

public class Main {
  public static void main(String[] args) {
    FastScanner fs = new FastScanner();

    String S = fs.next(), ans = "Yes";

    for (int i = 0; i < S.length(); i++) {
      if (i % 2 == 1 && S.charAt(i) == 'R') ans = "No";
      if (i % 2 == 0 && S.charAt(i) == 'L') ans = "No";
    }

    System.out.println(ans);
  }
}

class FastScanner {
  private final InputStream in = System.in;
  private final byte[] buffer = new byte[1024];
  private int ptr = 0;
  private int buflen = 0;

  private boolean hasNextByte() {
    if (ptr < buflen) {
      return true;
    } else {
      ptr = 0;
      try {
        buflen = in.read(buffer);
      } catch (IOException e) {
        e.printStackTrace();
      }
      if (buflen <= 0) {
        return false;
      }
    }
    return true;
  }

  private int readByte() {
    if (hasNextByte())
    return buffer[ptr++];
    else
    return -1;
  }

  private static boolean isPrintableChar(int c) {
    return 33 <= c && c <= 126;
  }

  public boolean hasNext() {
    while (hasNextByte() && !isPrintableChar(buffer[ptr]))
    ptr++;
    return hasNextByte();
  }

  public String next() {
    if (!hasNext())
    throw new NoSuchElementException();
    StringBuilder sb = new StringBuilder();
    int b = readByte();
    while (isPrintableChar(b)) {
      sb.appendCodePoint(b);
      b = readByte();
    }
    return sb.toString();
  }

  public long nextLong() {
    if (!hasNext())
    throw new NoSuchElementException();
    long n = 0;
    boolean minus = false;
    int b = readByte();
    if (b == '-') {
      minus = true;
      b = readByte();
    }
    if (b < '0' || '9' < b) {
      throw new NumberFormatException();
    }
    while (true) {
      if ('0' <= b && b <= '9') {
        n *= 10;
        n += b - '0';
      } else if (b == -1 || !isPrintableChar(b)) {
        return minus ? -n : n;
      } else {
      throw new NumberFormatException();
      }
      b = readByte();
    }
  }

  public int nextInt() {
    long nl = nextLong();
    if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
    throw new NumberFormatException();
    return (int) nl;
  }

  public double nextDouble() {
    return Double.parseDouble(next());
  }
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.regex.Pattern;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String s = stdin.readLine();
        String t = ok(s) ? "Yes" : "No";
        System.out.println(t);
    }
    
    public static boolean ok(String s) {
        for (int i = 0; i < s.length(); i++) {
            char ch = s.charAt(i);
            if (i % 2 == 0) {
                if (ch == 'L') return false;
            } else {
                if (ch == 'R') return false;
            }
        }
        return true;
    }
}
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();

            boolean is = true;
            for (int i = 0; i < S.length(); i++) {
                char c = S.charAt(i);
                if (i % 2 == 1) {
                    if (!(c == 'R' || c == 'U' || c == 'D')) {
                        is = false;
                    }
                } else {
                    if (!(c == 'L' || c == 'U' || c == 'D')) {
                        is = false;
                    }
                }
            }

            System.out.println(is ? "Yes" : "No");
        }
    }
}
//  [java]
import java.util.*;
class Main{
    public static void main(String[] args) {
        Scanner sc  = new Scanner (System.in);
        String s = sc.nextLine();
        int len = s.length();
        boolean easyP = false;
        for(int i = 0;i<len-1;i+=2){
            if(s.charAt(i)=='R'||s.charAt(i)=='U'||s.charAt(i)=='D'){
                if(s.charAt(i+1)=='L'||s.charAt(i+1)=='U'||s.charAt(i+1)=='D'){
                    easyP = true;
                    continue;
                }
                else{
                    easyP = false;
                }
            }
            else{
                easyP = false;
            }

        }
        System.out.println(easyP?"Yes":"No");
    }
}
//  [java]
import java.util.*;
class Main{
    public static void main(String[] args) {
        Scanner sc  = new Scanner (System.in);
        String s = sc.nextLine();
        int len = s.length();
        boolean easyP = true;
        for(int i = 0;i<len-1;i+=2){
            if(s.charAt(i)=='R'||s.charAt(i)=='U'||s.charAt(i)=='D'){
                if(s.charAt(i+1)=='L'||s.charAt(i+1)=='U'||s.charAt(i+1)=='D'){
                    continue;
                }
                else{
                    easyP = false;
                }
            }
            else{
                easyP = false;
            }

        }
        System.out.println(easyP?"Yes":"No");
    }
}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;

int main() {
  string s;
  cin >> s;
  for(int i=0; i < s.size(); i++) {
    if((i+1)%2 == 1){
    if(!(s[i] == 'R' || s[i] == 'U' || s[i] == 'D')) {
      cout << "No" << endl;
      return 0;
    }
    }
    if((i+1)%2 == 0){
    if(!(s[i] == 'L' || s[i] == 'U' || s[i] == 'D')) {
      cout << "No" << endl;
      return 0;
    }
    }
  }
  cout << "Yes" << endl;
}
//  [cpp]
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " \n"[i==n-1];};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S;
    cin >> S;
    bool ok = true;
    ll N = S.size();
    rep(i,0,N){
        if(i % 2 == 0){
            if(S[i] == 'L') ok = false;
        }else{
            if(S[i] == 'R') ok = false;
        }
    }
    if(ok){
        print("Yes");
    }else{
        print("No");
    }

    
}
//  [cpp]
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#define rep(i, n) for(i = 0; i < n; i++)
#define int long long
using namespace std;

signed main() {
	string s;
	cin >> s;
	
	int i;
	rep(i, s.length()) {
		if (i % 2 == 0 && s[i] == 'L') { cout << "No" << endl; return 0; }
		if (i % 2 == 1 && s[i] == 'R') { cout << "No" << endl; return 0; }
	}
	cout << "Yes" << endl;
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main(){
  
  string S;
  cin >> S;
  int ans=0;
  
  for(int i=0; i<S.size(); i++) {   
    if(S.at(i)%2 == 0) {
      if(S.at(i) == 'R' || S.at(i) == 'U' || S.at(i) == 'D')
        continue;
      else {
        ans = 1;
        break;
      }
    }
    
    else {
      if(S.at(i) == 'L' || S.at(i) == 'U' || S.at(i) == 'D')
        continue;
      else {
        ans = 1;
        break;
      }
    }
  }
  
  if(ans == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
  
}
//  [cpp]
//https://atcoder.jp/contests/abc141/tasks/abc141_b
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin>>s;
	ll n;
	n=s.length();
	ll i;
	bool ans1=true;
	bool ans2=true;
	vector <char> lis;
	for(i=0;i<n;i++)
	{
		lis.push_back(s[i]);
	}
	if(n%2==0)
	{
		for(i=0;i<n-1;i=i+2)
		{
			if((lis[i]=='R')||(lis[i]=='U')||(lis[i]=='D'))
			{
				ans1=true;
			}
			else
			{
				ans1=false;
			}
		}
		for(i=1;i<n;i=i+2)
		{
			if((lis[i]=='L')||(lis[i]=='U')||(lis[i]=='D'))
			{
				ans2=true;
			}
			else
			{
				ans2=false;
			}
		}
	}
	else
	{
		for(i=0;i<n;i=i+2)
		{
			if((lis[i]=='R')||(lis[i]=='U')||(lis[i]=='D'))
			{
				ans1=true;
			}
			else
			{
				ans1=false;
			}
		}
		for(i=1;i<n-1;i=i+2)
		{
			if((lis[i]=='L')||(lis[i]=='U')||(lis[i]=='D'))
			{
				ans2=true;
			}
			else
			{
				ans2=false;
			}
		}
	}
	if((ans1==true)&&(ans2==true))
	{
		cout<<"Yes"<<"\n";
	}
	else
	{
		cout<<"No"<<"\n";
	}
	return 0;
}
//  [cpp]
//https://atcoder.jp/contests/abc141/tasks/abc141_b
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin>>s;
	ll n;
	n=s.length();
	ll i;
	bool ans1=false;
	bool ans2=false;
	vector <char> lis;
	for(i=0;i<n;i++)
	{
		lis.push_back(s[i]);
	}
	if(n%2==0)
	{
		for(i=0;i<n-1;i=i+2)
		{
			if((lis[i]=='R')||(lis[i]=='U')||(lis[i]=='D'))
			{
				ans1=true;
			}
			else
			{
				ans1=false;
			}
		}
		for(i=1;i<n;i=i+2)
		{
			if((lis[i]=='L')||(lis[i]=='U')||(lis[i]=='D'))
			{
				ans2=true;
			}
			else
			{
				ans2=false;
			}
		}
	}
	else
	{
		for(i=0;i<n;i=i+2)
		{
			if((lis[i]=='R')||(lis[i]=='U')||(lis[i]=='D'))
			{
				ans1=true;
			}
			else
			{
				ans1=false;
			}
		}
		for(i=1;i<n-1;i=i+2)
		{
			if((lis[i]=='L')||(lis[i]=='U')||(lis[i]=='D'))
			{
				ans2=true;
			}
			else
			{
				ans2=false;
			}
		}
	}
	if((ans1==true)&&(ans2==true))
	{
		cout<<"Yes"<<"\n";
	}
	else
	{
		cout<<"No"<<"\n";
	}
	return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>

int main () {
    char S[101];
    scanf("%s", S);
    int len = strlen(S);
    for (int i = 0; i < len; i++) {
        if ((i + 1) % 2 == 0 && S[i] != 'R') {
            continue;
        } else if ((i + 1) % 2 == 1 && S[i] != 'L') {
            continue;
        } else {
            printf("No\n");
            return 0;
        }
    }
    printf("Yes\n");

    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>

int main(void)
{
        int n,i,c;
        char s[100];

        scanf("%s",s);

        n=strlen(s);

        c=0;
        for(i=0;i<n;i++){
                if(i%2==0){
                        if(s[i]=='R' || s[i]=='U' || s[i]=='D') c++;
                }
                else {
                        if(s[i]=='L' || s[i]=='U' || s[i]=='D') c++;
                }
        }

        if(c==n) printf("Yes");
        else     printf("No");

        return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
int main()
{
	int i,n,t;
	t=0;
	char a[100];
	scanf("%s",a);
  
	for(i=0;i<strlen(a);i++)
	{
		if(i%2==0)
		{
			if(a[i]=='R'|| a[i]=='U' || a[i]=='D')
				t++;
		}
		else
		{
			if(a[i]=='L'||a[i]=='U'||a[i]=='D')
				t++;
		}
	}
	if(t==strlen(a))
		printf("Yes");
	else
		printf("No");
	
	return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>
int main()
{
	char s[101];
	int len=0,i,c=0,f1=0,f2=0;
	scanf("%s",s);
	len=strlen(s);
	for(i=1;i<=len;i++){
		if(i%2!=0){
			if(s[i]=='R'){
				f1=1;
			}
		}
		if(i%2==0){
			if(s[i]=='L'){
				f2=1;
			}
		}
	}
	//printf("%d %d\n",f1,f2);
	if(f1==1||f2==1){
		printf("No\n");
	}
	else{
		printf("Yes\n");
	}
	return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>

int main(void){

int oddcheck=0,evencheck=0;

char s[101];

scanf("%s",&s);

if(strlen(s)==1){
  if(s[0]=='R'||s[0]=='U'||s[0]=='D'){
    printf("Yes");
  }else{
    printf("No");
  }
}

if(strlen(s)>=2){
for(int i=0;i<strlen(s);i=i+2){
if(s[i]=='R'){oddcheck=0;}
else if(s[i]=='U'){oddcheck=0;}
else if(s[i]=='D'){oddcheck=0;}
else{oddcheck=1;}
}

for(int i=1;i<strlen(s);i=i+2){
if(s[i]=='L'){evencheck=0;}
else if(s[i]=='U'){evencheck=0;}
else if(s[i]=='D'){evencheck=0;}
else{evencheck=1;}
}

if(oddcheck==0&&evencheck==0){printf("Yes");}
if(oddcheck==1||evencheck==1){printf("No");}
}

return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>

int main(void){

int oddcheck=0,evencheck=0;

char s[101];

scanf("%s",&s);

if(strlen(s)==1){
  if(s[0]=='R'||s[0]=='U'||s[0]=='D'){
    printf("Yes");
  }else{
    printf("No");
  }
}


if(strlen(s)>=2){
for(int i=0;i<strlen(s);i=i+2){
if(s[i]=='R'){oddcheck=0;}
else if(s[i]=='U'){oddcheck=0;}
else if(s[i]=='D'){oddcheck=0;}
else{oddcheck=1;}
}

for(int i=1;i<strlen(s);i=i+2){
if(s[i]=='L'){evencheck=0;}
else if(s[i]=='U'){evencheck=0;}
else if(s[i]=='D'){evencheck=0;}
else{oddcheck=1;}
}

if(oddcheck==0&&evencheck==0){printf("Yes");}
if(oddcheck==1||evencheck==1){printf("No");}
}

return 0;
}
//  [javascript]
Main = input => {
  s = input.trim();
  
  for (var i = 0; i < s.length; i++) {
    if (i % 2 === 0 && s[i] === "L") {
      console.log("No");
      return;
    }
    
    if (i % 2 && s[i] === "R") {
      console.log("No");
      return;
    }
  }
  
  console.log("Yes");
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main (S) {
  S = S.split("\n")[0].split("");
  var ans = "Yes";
  S.forEach((element, index) => {
    switch ((index+1)%2) {
      case 0:
        switch (element) {
          case "L":
          case "U":
          case "D":
            break;
          default:
            ans = "No";
            break;
                       }
        break;
      case 1:
        switch (element) {
          case "R":
          case "U":
          case "D":
            break;
          default:
            ans = "No"
            break;
         }
                       }
    });
  console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
  input = input.trim().slice('');
  var flag = 'Yes';
  for(var i = 0, len = input.length; i < len; i++) {
    if(i % 2 == 0) {
      if(input[i] == 'L') flag = 'No';
    } else {
      if(input[i] == 'R') flag = 'No';
    }
    if(flag == 'No') {
      break;
    }
  }
  console.log(flag);
}
Main(require('fs').readFileSync('/dev/stdin', 'utf-8'));
//  [javascript]
"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    let s = next()
    for(let i = 0; i<s.length; i++){
        if(i+1 % 2 == 0){
            if(!"LUD".includes(s[i])){
                console.log("No")
                return
            }
        } else{
            if(!"RUD".includes(s[i])){
                console.log("No")
                return
            }
        } 
    }
    console.log("Yes")
}
Main()
//  [javascript]
'use strict';
function main(input) {
  const arr = input.trim().split('\n');
  const a = arr[0];
  let isStep = true;

  for (let i = 0; i < a.length; i ++) {
    if (a % 2 === 0 && a[i] === 'R') {
      isStep = false;
    } else if (a % 2 !== 0 && a[i] === 'L'){
      isStep = false;
    }
  }
  
  console.log(isStep ? 'Yes' : 'No');
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict';
function main(input) {
  const arr = input.trim().split('\n');
  const a = arr[0];
  let isStep = true;

  for (let i = 0; i < a.length; i ++) {
    if (a % 2 === 0 && a[i] === 'L') {
      isStep = false;
    } else if (a % 2 !== 0 && a[i] === 'R'){
      isStep = false;
    }
  }
  
  console.log(isStep ? 'Yes' : 'No');
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

const (
	defaultBufferSize = 1024
	maxBufferSize     = 1e6
	Mod               = 1e9 + 7
)

var sc = bufio.NewScanner(os.Stdin)

// sc.Buffer(make([]byte, defaultBufferSize), maxBufferSize)

func readInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func readString() string {
	sc.Scan()
	return sc.Text()
}

func readInt64() int64 {
	sc.Scan()
	i, err := strconv.ParseInt(sc.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return int64(i)
}

func readfloat64() float64 {
	sc.Scan()
	f, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}
	return f
}

func abs(a int) int {
	if a < 0 {
		return a * -1
	}
	return a
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func gcd(x, y int) int {
	if y == 0 {
		return x
	}
	return gcd(y, x%y)
}

func ModComb(n, k int) int {
	if k == 0 {
		return 1
	}
	x, y := n, k
	for i := 1; i < k; i++ {
		x = x * (n - i) % Mod
		y = y * (k - i) % Mod
	}
	inv := ModInv(y)
	return x * inv % Mod
}

func ModFact(x int) int {
	fact := 1
	for i := 1; i <= x; i++ {
		fact = fact * i % Mod
	}
	return fact
}

func ModInv(x int) int {
	return ModPow(x, Mod-2)
}

func ModPow(a, n int) int {
	res := 1
	for n > 0 {
		if n%2 != 0 {
			res = res * a % Mod
		}
		a = a * a % Mod
		n /= 2
	}
	return res
}

func pow(a, n int) int {
	if n == 0 {
		return 1
	}

	ans := 0
	if n%2 == 0 {
		ans = pow(a*a, n/2)
	} else {
		ans = a * pow(a*a, (n-1)/2)
	}
	return ans
}

func intSliceReverse(slice []int) []int {
	for i, j := 0, len(slice)-1; i < j; i, j = i+1, j-1 {
		slice[i], slice[j] = slice[j], slice[i]
	}
	return slice
}

func stringReverse(str string) string {
	runes := []rune(str)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func primeFactorization(x int) map[int]int {
	result := make(map[int]int, 0)
	for i := 2; i*i <= x; i++ {
		for x%i == 0 {
			result[i]++
			x /= i
		}
	}
	if x != 1 {
		result[x]++
	}
	return result
}

func isPrime(x int) bool {
	if x == 1 {
		return false
	}
	for i := 2; i*i <= x; i++ {
		if i == x {
			continue
		}
		if x%i == 0 {
			return false
		}
	}
	return true
}

func main() {
	sc.Split(bufio.ScanWords)
	s := readString()

	check := true
	for i, v := range s {
		if i%2 == 0 {
			if v == 'R' || v == 'U' || v == 'D' {
				continue
			}
		} else {
			if v == 'L' || v == 'U' || v == 'D' {
				continue
			}
		}
		check = false
	}
	if check {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func main() {
	sc.Split(bufio.ScanWords)
	s := next()
	ok := true
	for i := range s {
		if i%2 == 0 && s[i] == 'L' {
			ok = false
			break
		} else if i%2 == 1 && s[i] == 'R' {
			ok = false
			break
		}
	}
	if ok {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	S := getStdin()
	for i := 0; i < len(S); i++ {
		if i%2 == 0 && (S[i] == 'R') {
			fmt.Printf("No\n")
			return
		}
		if i%2 == 1 && (S[i] == 'L') {
			fmt.Printf("No\n")
			return
		}
	}
	fmt.Printf("Yes\n")
}

var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)

func getStdin() string {
	return readLine()
}
func getStdinInt() int {
	str := getStdin()
	rtn, _ := strconv.Atoi(str)
	return rtn
}
func getStdinInt2() (int, int) {
	list := getStdinIntArr()
	return list[0], list[1]
}
func getStdinInt3() (int, int, int) {
	list := getStdinIntArr()
	return list[0], list[1], list[2]
}
func getStdinInt64() int64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return rtn
}
func getStdinIntU64() uint64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return uint64(rtn)
}
func getStdinInt64_2() (int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1]
}
func getStdinInt64_3() (int64, int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1], list[2]
}
func getStdinIntArr() []int {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}
func getStdinIntArr64() []int64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}
func getStdinIntArrU64() []uint64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]uint64, len(list))
	for idx, val := range list {
		r, _ := strconv.ParseInt(val, 10, 64)
		rtn[idx] = uint64(r)
	}
	return rtn
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}
func max64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func abs(n int) int {
	if n < 0 {
		return -n
	}
	return n
}
func abs64(n int64) int64 {
	if n < 0 {
		return -n
	}
	return n
}
func readLine() string {
	buf := make([]byte, 0, 0)
	for {
		l, p, _ := sc.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
	"unsafe"
)

func main() {
	S := sc.next()
	SArr := strings.Split(S, "")
	var ng bool
	for i := 0; i < len(SArr); i++ {
		if (i+1)%2 == 0 {
			if SArr[i] == "R" {
				ng = true
				fmt.Println(i, SArr[i])
			}
		}
		if (i+1)%2 != 0 {
			if SArr[i] == "L" {
				ng = true
				fmt.Println(i, SArr[i])
			}
		}
	}
	if ng {
		no()
	} else {
		yes()
	}
}

var (
	sc scanner
)

func init() {
	sc = scanner{
		buf: make([]string, 0, 0),
		cur: 0,
		r:   bufio.NewReader(os.Stdin),
	}
}

type scanner struct {
	buf []string
	cur int
	r   *bufio.Reader
}

func (s *scanner) readln() {
	rbuf := make([]byte, 0, 0)
	for {
		line, prefix, err := s.r.ReadLine()
		if err != nil {
			panic(err)
		}
		rbuf = append(rbuf, line...)
		if prefix == false {
			break
		}
	}
	s.cur = 0
	s.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), " ")
}
func (s *scanner) isFull() bool {
	if s.cur == len(s.buf) {
		return true
	}
	return false
}
func (s *scanner) resetCur() {
	s.cur = 0
}
func (s *scanner) next() string {
	if s.cur == 0 {
		s.readln()
	}
	res := s.buf[s.cur]
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nexts() []string {
	s.readln()
	s.resetCur()
	return s.buf
}
func (s *scanner) nextInt() int {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.Atoi(s.buf[s.cur])
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nextInts() []int {
	s.readln()
	res := make([]int, len(s.buf))
	for i := range s.buf {
		res[i], _ = strconv.Atoi(s.buf[i])
	}
	s.resetCur()
	return res
}
func (s *scanner) nextFloat() float64 {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.ParseFloat(s.buf[s.cur],
		64)
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nextFloats() []float64 {
	s.readln()
	res := make([]float64, len(s.buf))
	for i := range s.buf {
		res[i], _ = strconv.ParseFloat(s.buf[i],
			64)
	}
	s.resetCur()
	return res
}
func digits(x int) int {
	return len(strconv.Itoa(x))
}
func powInt(x, p int) (result int) {
	result = 1
	for i := 0; i < p; i++ {
		result *= x
	}
	return
}
func max(x, y int) int {
	return int(math.Max(float64(x), float64(y)))
}
func min(x, y int) int {
	return int(math.Min(float64(x), float64(y)))
}
func abs(x int) int {
	return int(math.Abs(float64(x)))
}
func varDump(value ...interface{}) {
	for _, v := range value {
		fmt.Fprintf(os.Stderr, "%#v\n", v)
	}
}
func yes() {
	fmt.Println("Yes")
}
func no() {
	fmt.Println("No")
}

// Pair a
type Pair struct {
	first  int
	second int
}

// Queue a
type Queue struct {
	v []Pair
}

// Push for queue
func (q *Queue) Push(v Pair) {
	q.v = append(q.v, v)
}

// Pop for queue
func (q *Queue) Pop() Pair {
	r := q.v[0]
	q.v = q.v[1:]
	return r
}

// Front for queue
func (q Queue) Front() Pair {
	return q.v[0]
}

// Empty return true if empty
func (q Queue) Empty() bool {
	return len(q.v) == 0
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var s string
	fmt.Scan(&s)

	ans := "YES"
	for i := 0; i < len(s); i++ {
		if (i+1)%2 == 0 {
			if s[i:i+1] == "R" {
				ans = "NO"
				break
			}
		} else {
			if s[i:i+1] == "L" {
				ans = "NO"
				break
			}
		}
	}
	fmt.Println(ans)
}
//  [ruby]
ary = gets.chomp.chars 
x = ary.each_slice(2).map { |a, b| [a, b] }.transpose
puts x[0].include?("L") || x[1].include?("R") ? "No" : "Yes"
//  [ruby]
S = gets.chomp.split('')
flag = true
S.each_with_index do |s,i|
    if i%2==0 then
        # 奇数
        flag = false if s == 'L'
    else
        flag = false if s == 'R'
    end
    break unless flag
end
puts flag ? "Yes" : "No"
//  [ruby]
s = gets.chomp

s.split("").each.with_index do |ss, i|
  ng = if i % 2 == 0
    "L"
  else
    "R"
  end
  if ss == ng
    print "No\n"
    exit
  end
end
print "Yes\n"
//  [ruby]
gets.chomp.each_char.with_index do |s,i|
  if i%2==0
    unless [?R,?U,?D].include? s
      p [s,i]
      puts 'No'
      exit
    end
  else
    unless [?L,?U,?D].include? s
      p [s,i]
      puts 'No'
      exit
    end
  end
end
puts 'Yes'
//  [ruby]
gets.each_char.with_index do |s,i|
  if i%2==0
    unless [?R,?U,?D].include? s
      puts 'No'
      exit
    end
  else
    unless [?L,?U,?D].include? s
      puts 'No'
      exit
    end
  end
end
puts 'Yes'
//  [ruby]
s=gets
p (0...s.size).any?{s[_1]=="LR"[_1%2]} ? :No : :Yes
//  [rust]
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn f(s: &[char]) -> bool {
    let m = s.len();
    for i in 0..m {
        if s[i] != s[m - 1 - i] {
            return false;
        }
    }
    true
}

use std::iter::Iterator;

fn main() {
    input! {
        s:chars
    }

    let mut ans = true;
    for i in 0..s.len() {
        if i % 2 == 0 {
            if s[i] == 'L' {
                ans = false;
                break;
            }
        } else if i % 2 == 1 {
            if s[i] == 'R' {
                ans = false;
                break;
            }
        }

    }
    println!("{}", if ans { "Yes" } else { "No" });

}
//  [rust]
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        s: chars,
    }
    for i in 0..s.len() {
        if (i % 2 == 0 && s[i] == 'L') || (i % 2 == 1 && s[i] == 'R'){
            println!("No");
            return;
        }
    }
    println!("Yes");
}
//  [rust]
use std::io::{self, BufRead};

fn main() {
    let stdin = io::stdin();
    let s = stdin.lock().lines().next().unwrap().unwrap();
    let ans = if s
        .chars()
        .enumerate()
        .all(|(i, c)| (i + 1) % 2 == 1 && c != 'L' || (i + 1) % 2 == 0 && c != 'R')
    {
        "Yes"
    } else {
        "No"
    };
    println!("{}", ans);
}
//  [rust]
fn main() {
    use std::collections::HashSet;

    let s: String = read_line_as_value();
    let mut odd_chars = HashSet::new();
    odd_chars.insert('R');
    odd_chars.insert('U');
    odd_chars.insert('D');
    let mut even_chars = HashSet::new();
    even_chars.insert('L');
    even_chars.insert('U');
    even_chars.insert('D');

    let mut ans = true;
    for (i, c) in s.chars().enumerate() {
        if (i+1) % 2 == 0 && even_chars.contains(&c) {
            continue
        } else if (i+1) % 2 == 1 && odd_chars.contains(&c) {
            continue
        } else {
            ans = false;
            break
        }
    }
    match ans {
        true => println!("Yes"),
        false => println!("No"),
    }
}
//  [rust]
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let s = read_as_string().chars().collect::<Vec<char>>();

    for i in 0..s.len(){
        if (i%2 == 0 && s[i] == 'R') || (i%2 == 1 && s[i] == 'L'){
            println!("No");
        }
    }
    println!("Yes");

}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        s: chars
    }
    let ok: bool = true;

    for i in 0..s.len() {
        let t: char = s[i];
        if i % 2 == 0 {
            //　奇数
            if t == 'L' {
                ok = false;
            }
        } else {
            // 偶数
            if t == 'R' {
                ok = false;
            }
        }
    }

    if ok {
        println!("Yes");
    }else {
        println!("No");
    }
}
//  [swift]
let s=readLine()!
var S=Array(s)
var count=1
var k=0
for x in S{
  if count%2==1{
    if x == "L"{
      k=1
    }
  }else{
    if x == "R"{
      k=1
    }
  }
  count+=1
}
if k==1{
  print("No")
}else{
  print("Yes")
}
//  [swift]
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let str=readLine()!
var flag=0

var i=0
for j in str{
  if i%2==1&&(j == "R"){flag-=1
                      break}
  if i%2==0&&(j == "L"){flag-=1
                      break}
  i+=1
}
if flag == -1 {print("No")}else{print("Yes")}
//  [swift]
//https://atcoder.jp/contests/abc141/submissions/7559296

var ans = "Yes"
for(i, c)in readLine()!.characters.enumerate() {
  if i % 2 == 0 && c == "L" || i % 2 > 0 && c == "R" {
    ans = "No"
  }
}
print(ans)
//  [swift]
print(readLine()!.characters.enumerate().reduce("Yes"){$1.0%2==0&&$1.1=="L"||$1.0%2>0&&$1.1=="R" ?"No":$0})
//  [swift]
var ans="Yes"
for(i,c)in readLine()!.characters.enumerate(){
  if i%2==0&&c=="L"||i%2>0&&c=="R"{
    ans="No"
  }
}
print("No")
//  [swift]
var ans="No"
for(i,c)in readLine()!.characters.enumerate(){
  if i%2==0&&c=="L"||i%2>0&&c=="R"{
    ans="No"
  }
}
print("No")
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
//const n = +input[0];
//const a = [];
//for(let i=0;i<n;i++){
//	a.push(input[i+1].split(" ").map((x:string):number=>+x));
//}

//const [n, m] = input[0].split(" ").map((x: string): number => +x);
//const a = input[1].split(" ").map((x: string): number => +x);

function compareFunc(a, b){
    return a-b;
}

const s: string[] = input[0].split('');
let ans: string = 'Yes';
const len: number = s.length;
for(let i = 0; i < len; i++){
    if (i % 2 === 0){
        if(s[i] === 'L'){
            ans = 'No';
        }
    }else{
        if(s[i] === 'R'){
            ans = 'No';
        }
    }
}
console.log(ans);
//  [typescript]
const t={input:require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/),n:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.n())}return a}else{const a=t.input[0];t.input.shift();return Number(a)}},s:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.s())}return a}else{const a=t.input[0];t.input.shift();return String(a)}},c:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.c())}return a}else{let a=t.input[0].split('');const b=a[0];a.shift();if(a.length>0){t.input[0]=a.join('')}else{t.input.shift()}return String(b)}},o:(...arg)=>{console.log(...arg)},abs:(a)=>{return Math.abs(a)},min:(...a)=>{return Math.min(...a)},max:(...a)=>{return Math.max(...a)},floor:(a)=>{return Math.floor(a)},asc:(ar:number[])=>{return ar.sort((a,b)=>{return a-b})},desc:(ar:number[])=>{return ar.sort((a,b)=>{return b-a})},sw:(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1];}return arr[arr.length-1]}};
const main=()=>{
  let s=t.s().split('');
  let ans='Yes'
  for(let i=0;i<s.length; i++){
    if(i%2==0&&s[i]=='L'){
      ans='No'
      break;
    }else if(i%2!=0&&s[i]=='R'){
      ans='No'
      break;
    }
  }
  t.o(ans)
}
main()
//  [typescript]
const main = lines => {
  const strArr = lines.split("");
  let result = "Yes";

  strArr.forEach((str, index) => {
    index += 1;
    if (index % 2 === 1) {
      if (str === "L") {
        result = "No";
      }
    } else {
      if (str === "R") {
        result = "No";
      }
    }
  });

  console.log(result);
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
import { readFileSync } from 'fs'
function main() {
  const input = readFileSync('/dev/stdin', 'utf8')
  const s = input.trim().split('')
  const oddArray = ['R', 'U', 'D']
  const evenArray = ['L', 'U', 'D']
  let judge = 'Yes'
  for (let i = 0; i < s.length; i++) {
    if ((i + 1) % 2 === 0 && !evenArray.includes(s[i])) {
      judge = 'No'
      break
    } else if ((i + 2) % 2 === 0 && !oddArray.includes(s[i])) {
      judge = 'No'
      break      
    }
  }
  console.log(judge)
}
main()
//  [typescript]
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  string s;
  cin >> s;

  string ans = "Yes";
  for (int i = 0; i < s.size(); i++) {
    char c = s.at(i);

    if ((i + 1) % 2 == 0) {
      if (c == 'R') ans = "No";
    } else {
      if (c == 'L') ans = "No";
    }
  }

  cout << ans << endl;

  return 0;
}
//  [python]
import math

A,B,H,M=map(int, input().split())

sh=math.pi*(H+M/60)/6
sm=math.pi*M/30

s=abs(sh-sm)

C=math.sqrt(A**2+B**2-2*A*B*math.cos(s))

print(C)
//  [python]
import math
A, B, H, M = map(int, input().split())
h = H / 12 * 360 + 0.5 * M
m = M / 60 * 360
Ax = A * math.sin(math.radians(h))
Ay = A * math.cos(math.radians(h))
Bx = B * math.sin(math.radians(m))
By = B * math.cos(math.radians(m))
print(((Ax - Bx) ** 2 + (Ay - By) ** 2) ** 0.5)
//  [python]
import math
a,b,h,m = map(int,input().split())
ans = 0
ang = 0
tan = 30*h+0.5*m
cho = 6*m
ang = abs(cho-tan)
#print(tan,cho,ang)

ans = math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(ang)))
print(ans)
//  [python]
import math
A,B,H,M = map(int, input().split())
H = 60*H + M
pi = (math.pi/180)
HP = [A*math.cos(0.5*H*pi), A*math.sin(0.5*H*pi)]
MP = [B*math.cos(6*M*pi), B*math.sin(6*M*pi)]
print(HP, MP)
print(math.sqrt((HP[0]-MP[0])**2 + (HP[1]-MP[1])**2))