Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
n, m, q = map(int, input().split())
x = [[0 for i in range(n + 1)] for j in range(n + 1)]
c = [[0 for i in range(n + 1)] for j in range(n + 1)]
for i in range(m):
    l, r = map(int, input().split())
    c[l][r] += 1
for i in range(1, n + 1):
    for j in range(1, n + 1):
        x[i][j] = x[i][j - 1] + c[i][j]
for k in range(q):
    ans = 0
    p, q2 = map(int, input().split())
    for i in range(p, q2 + 1):
        ans += x[i][q2] - x[i][p - 1]
    print(ans)

Fixed submission:
import sys
input = sys.stdin.readline
n, m, q = map(int, input().split())
x = [[0 for i in range(n + 1)] for j in range(n + 1)]
c = [[0 for i in range(n + 1)] for j in range(n + 1)]
for i in range(m):
    l, r = map(int, input().split())
    c[l][r] += 1
for i in range(1, n + 1):
    for j in range(1, n + 1):
        x[i][j] = x[i][j - 1] + c[i][j]
for k in range(q):
    ans = 0
    p, q2 = map(int, input().split())
    for i in range(p, q2 + 1):
        ans += x[i][q2] - x[i][p - 1]
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, m, q = map(int, input().split())
x = [[0 for i in range(n + 1)] for j in range(n + 1)]
c = [[0 for i in range(n + 1)] for j in range(n + 1)]
for i in range(m):
    l, r = map(int, input().split())
    c[l][r] += 1
for i in range(1, n + 1):
    for j in range(1, n + 1):
        x[i][j] = x[i][j - 1] + c[i][j]
for k in range(q):
    ans = 0
    p, q2 = map(int, input().split())
    for i in range(p, q2 + 1):
        ans += x[i][q2] - x[i][p - 1]
    print(ans)

Fixed submission:
import sys
input = sys.stdin.readline
n, m, q = map(int, input().split())
x = [[0 for i in range(n + 1)] for j in range(n + 1)]
c = [[0 for i in range(n + 1)] for j in range(n + 1)]
for i in range(m):
    l, r = map(int, input().split())
    c[l][r] += 1
for i in range(1, n + 1):
    for j in range(1, n + 1):
        x[i][j] = x[i][j - 1] + c[i][j]
for k in range(q):
    ans = 0
    p, q2 = map(int, input().split())
    for i in range(p, q2 + 1):
        ans += x[i][q2] - x[i][p - 1]
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, m, q = map(int, input().split())
x = [[0 for i in range(n + 1)] for j in range(n + 1)]
c = [[0 for i in range(n + 1)] for j in range(n + 1)]
for i in range(m):
    l, r = map(int, input().split())
    c[l][r] += 1
for i in range(1, n + 1):
    for j in range(1, n + 1):
        x[i][j] = x[i][j - 1] + c[i][j]
for k in range(q):
    ans = 0
    p, q2 = map(int, input().split())
    for i in range(p, q2 + 1):
        ans += x[i][q2] - x[i][p - 1]
    print(ans)

Fixed submission:
import sys
input = sys.stdin.readline
n, m, q = map(int, input().split())
x = [[0 for i in range(n + 1)] for j in range(n + 1)]
c = [[0 for i in range(n + 1)] for j in range(n + 1)]
for i in range(m):
    l, r = map(int, input().split())
    c[l][r] += 1
for i in range(1, n + 1):
    for j in range(1, n + 1):
        x[i][j] = x[i][j - 1] + c[i][j]
for k in range(q):
    ans = 0
    p, q2 = map(int, input().split())
    for i in range(p, q2 + 1):
        ans += x[i][q2] - x[i][p - 1]
    print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
f = False
for i in range(int(n/4)):
    for j in range((n/7)):
      if 4*i + 7*j == n:
        f = True
if f:
  print('Yes')
else:
  print('No')

Fixed submission:
n = int(input())
ans = 'No'
for i in range(n):
    for j in range(n):
        if 7*i + 4*j == n:
            ans = 'Yes'
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N % 10 == 0:
    print(10)
else:
    s = 0
    for i in str(N):
        s += int(i)
	print(s)

Fixed submission:
N = int(input())
if N % 10 == 0:
    print(10)
else:
    s = 0
    for i in str(N):
        s += int(i)
    print(s)
Buggy python submission (verdict: Runtime Error):
import numpy
n = int(input())
s = input()
a = [0]*n
ans = 10**6
for i in range(n):
    if s[i] == 'W':
        a[i] = 1
res = numpy.cumsum(a)
for i in range(n):
    x = res[i]-str(a[i]).count('1')
    y = n-i-1-(res[n-1]-res[i])
    ans = min(ans,x+y)
print(ans)

Fixed submission:
import numpy
n = int(input())
s = input()
a = [0]*n
ans = 10**6
for i in range(n):
    if s[i] == 'W':
        a[i] = 1
res = numpy.cumsum(a)
for i in range(n):
    x = res[i]-str(a[i]).count('1')
    y = n-i-1-(res[n-1]-res[i])
    ans = min(ans,x+y)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
n = int(input())
s = input()
ans = 10**6
for i in range(len(s)):
    x = collections.Counter(s[:i])
    y = collections.Counter(s[i+1:len(s)])
    ans = min(ans,x["W"]+y["E"])
print(ans)

Fixed submission:
import numpy
n = int(input())
s = input()
a = [0]*n
ans = 10**6
for i in range(n):
    if s[i] == 'W':
        a[i] = 1
res = numpy.cumsum(a)
for i in range(n):
    x = res[i]-str(a[i]).count('1')
    y = n-i-1-(res[n-1]-res[i])
    ans = min(ans,x+y)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
n = int(input())
s = input()
ans = 10**6
for i in range(len(s)):
    x = collections.Counter(s[:i])
    y = collections.Counter(s[i+1:len(s)])
    ans = min(ans,x["W"]+y["E"])
print(ans)

Fixed submission:
import numpy
n = int(input())
s = input()
a = [0]*n
ans = 10**6
for i in range(n):
    if s[i] == 'W':
        a[i] = 1
res = numpy.cumsum(a)
for i in range(n):
    x = res[i]-str(a[i]).count('1')
    y = n-i-1-(res[n-1]-res[i])
    ans = min(ans,x+y)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
ans = 10**6
for i in range(len(s)):
    x = s[:i]
    y = s[i+1:len(s)]
    ans = min(ans,x.count("W")+y.count("E"))
print(ans)

Fixed submission:
import numpy
n = int(input())
s = input()
a = [0]*n
ans = 10**6
for i in range(n):
    if s[i] == 'W':
        a[i] = 1
res = numpy.cumsum(a)
for i in range(n):
    x = res[i]-str(a[i]).count('1')
    y = n-i-1-(res[n-1]-res[i])
    ans = min(ans,x+y)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
X = list(map(int, input().split()))
temp = 0
for i in range(N):
    temp = X[i]
    X[i] = 0
    print(sorted(X)[int(N/2)])
    X[i] = temp

Fixed submission:
N = int(input())
X = list(map(int, input().split()))
Xs = sorted(X)
for i in range(N):
    if X[i] < Xs[int(N/2)]:
        print(Xs[int(N/2)])
    else:
        print((Xs[int(N/2)-1]))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = [0]*N
tmp = A[0]
for i in range(N):
    if i == 0: 
        A[i] = 0
    else:
        tmp = A[i]
        A[i] = A[i-1]
    ans[i] += abs(A[0])
    for j in range(N-1):
        ans[i] += abs(A[j]-A[j+1])
    ans[i] += abs(A[N-1])
    A[i] = tmp
    print(ans[i])

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

all = abs(A[0]) + abs(A[N-1])
for i in range(N-1):
    all += abs(A[i+1] - A[i])

print(all - (abs(A[0]) + abs(A[1]-A[0])) + abs(A[1]))

for i in range(1, N-1):
    print(all- (abs(A[i+1]-A[i]) + abs(A[i-1] - A[i])) + abs(A[i+1]-A[i-1]))
    
print(all - (abs(A[N-1])+abs(A[N-1]-A[N-2])) + abs(A[N-2]))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = [0]*N
tmp = A[0]
for i in range(N):
    if i == 0: 
        A[i] = 0
    else:
        tmp = A[i]
        A[i] = A[i-1]
    ans[i] += abs(A[0])
    for j in range(N-1):
        ans[i] += abs(A[j]-A[j+1])
    ans[i] += abs(A[N-1])
    A[i] = tmp
for i in range(N):
    print(ans[i])

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

all = abs(A[0]) + abs(A[N-1])
for i in range(N-1):
    all += abs(A[i+1] - A[i])

print(all - (abs(A[0]) + abs(A[1]-A[0])) + abs(A[1]))

for i in range(1, N-1):
    print(all- (abs(A[i+1]-A[i]) + abs(A[i-1] - A[i])) + abs(A[i+1]-A[i-1]))
    
print(all - (abs(A[N-1])+abs(A[N-1]-A[N-2])) + abs(A[N-2]))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = [0]*N
tmp = A[0]
for i in range(N):
    if i == 0: 
        A[i] = 0
    else:
        tmp = A[i]
        A[i] = A[i-1]
    ans[i] += abs(A[0])
    for j in range(N-1):
        ans[i] += abs(A[j]-A[j+1])
    ans[i] += abs(A[N-1])
    A[i] = tmp
for i in range(N):
    print(ans[i])

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

all = abs(A[0]) + abs(A[N-1])
for i in range(N-1):
    all += abs(A[i+1] - A[i])

print(all - (abs(A[0]) + abs(A[1]-A[0])) + abs(A[1]))

for i in range(1, N-1):
    print(all- (abs(A[i+1]-A[i]) + abs(A[i-1] - A[i])) + abs(A[i+1]-A[i-1]))
    
print(all - (abs(A[N-1])+abs(A[N-1]-A[N-2])) + abs(A[N-2]))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ans=0
if n==1 and m==1:
    ans=1
else:
    ans=abs(n-2)*abs(m-2)
print(ans)

Fixed submission:
s1=input()
s2=input()
s3=input()
print(s1[0]+s2[1]+s3[2])

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ans=0
if n==1 and m==1:
    ans=1
else:
    ans=(n-2)*(m-2)
print(ans)

Fixed submission:
s1=input()
s2=input()
s3=input()
print(s1[0]+s2[1]+s3[2])

Buggy python submission (verdict: Runtime Error):
s1 = list(map(str, input().split()))
s2 = list(map(str, input().split()))
s3 = list(map(str, input().split()))
print(s1[0]+s2[1]+s3[2])

Fixed submission:
s1=input()
s2=input()
s3=input()
print(s1[0]+s2[1]+s3[2])
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]

c = 0
for i in range(n):
    ai = a[i]
    bi = b[i]
    if ai < bi:
        c += (bi-ai)//2
    else:
        c -= (ai-bi)
print('Yes' if c >= 0 else 'No')


Fixed submission:
x,y=map(int,input().split())
if x%y==0:
    print('-1')
else:
    print(x)

Buggy python submission (verdict: Time Limit Exceeded):
x,y=map(int,input().split())
ans=False
for i in range(1,10**18):
    if(i % x) == 0 and (i % y) != 0:
        ans=True
        break
    else:
        continue
if ans: print(i)
else: print(-1)

Fixed submission:
x,y=map(int,input().split())
if x%y==0:
    print('-1')
else:
    print(x)
Buggy python submission (verdict: Runtime Error):
import math
x, y = map(int,input().split())
print(int(math.log2(y/x,2))+1)

Fixed submission:
x, y = map(int, input().split())
cnt = 0
while x <= y:
    x *= 2
    cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
import collections
n, k = map(int,input().split())
a = list(map(int, input().split()))
c = collections.Counter(a)
ans = 0
if len(set(a)) <= k:
    print(ans)
    exit()
for i in range(0,k):
    ans += c.most_common()[i][1]
print(n-ans)

Fixed submission:
import collections
n, k = map(int,input().split())
a = list(map(int, input().split()))
c = collections.Counter(a)
ans = 0
cnt = 0
if len(set(a)) <= k:
    print(ans)
    exit()
for  tuple in c.most_common():
    ans += tuple[1]
    cnt += 1
    if cnt == k:
      print(n-ans)
      exit()

Buggy python submission (verdict: Time Limit Exceeded):
import collections
n, k = map(int,input().split())
a = list(map(int, input().split()))
c = collections.Counter(a)
ans = 0
if len(set(a)) <= k:
    print(ans)
    exit()
for i in range(0,k):
    ans += c.most_common()[i][1]
print(n-ans)

Fixed submission:
import collections
n, k = map(int,input().split())
a = list(map(int, input().split()))
c = collections.Counter(a)
ans = 0
cnt = 0
if len(set(a)) <= k:
    print(ans)
    exit()
for  tuple in c.most_common():
    ans += tuple[1]
    cnt += 1
    if cnt == k:
      print(n-ans)
      exit()

Buggy python submission (verdict: Time Limit Exceeded):
import collections
n, k = map(int,input().split())
a = list(map(int, input().split()))
c = collections.Counter(a)
ans = 0
if len(set(a)) <= k:
    print(ans)
    exit()
for i in range(k,len(c)):
    ans += c.most_common()[i][1]
print(ans)

Fixed submission:
import collections
n, k = map(int,input().split())
a = list(map(int, input().split()))
c = collections.Counter(a)
ans = 0
cnt = 0
if len(set(a)) <= k:
    print(ans)
    exit()
for  tuple in c.most_common():
    ans += tuple[1]
    cnt += 1
    if cnt == k:
      print(n-ans)
      exit()

Buggy python submission (verdict: Time Limit Exceeded):
import collections
n, k = map(int,input().split())
a = list(map(int, input().split()))
c = collections.Counter(a)
ans = 0
if len(set(a)) <= k:
    print(ans)
    exit()
for i in range(k,len(c)):
    ans += c.most_common()[i][1]
print(ans)

Fixed submission:
import collections
n, k = map(int,input().split())
a = list(map(int, input().split()))
c = collections.Counter(a)
ans = 0
cnt = 0
if len(set(a)) <= k:
    print(ans)
    exit()
for  tuple in c.most_common():
    ans += tuple[1]
    cnt += 1
    if cnt == k:
      print(n-ans)
      exit()
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = [0]*100
L[0] = 2
L[1] = 1
for i in range(2,N+1):
    L[i] = L[i-1] + L[i-2]
print(L[i])

Fixed submission:
N = int(input())
L = [0]*100
L[0] = 2
L[1] = 1
if N == 0 or N == 1:
    print(L[N])
    exit()
for i in range(2,N+1):
    L[i] = L[i-1] + L[i-2]
print(L[i])
Buggy python submission (verdict: Runtime Error):
x, y = map(int, input().split())
X = abs(x)
Y = abs(y)
if x * y < 0:
    print(max(Y - X, X - Y) + 1)
else:
    print(max(x - y, y - x) + 2 * (y < x))x, y = map(int, input().split())
X = abs(x)
Y = abs(y)
if x * y < 0:
    print(max(Y - X, X - Y) + 1)
elif x * y > 0:
    print(max(x - y, y - x) + (y < x) + (X > 0))

Fixed submission:
x, y = map(int, input().split())
print(min(a for a in [y - x, y + x + 1, -y - x + 1, -y + x + 2] if a >= 0))
Buggy python submission (verdict: Runtime Error):
import sys 

A, B = int(input()).split()
cond_older = (13 > A)
cond_young = (6 <= A) & (13 >= A)

ans = (
  B if cond_older else
  B//2 if cond_young else
  0
)

print(ans)

Fixed submission:
import sys 
 
A, B = map(int, input().split())
cond_older = (12 < A)
cond_young = (6 <= A) & (12 >= A)
 
ans = (
  B if cond_older else
  B//2 if cond_young else
  0
)
 
print(ans)
Buggy python submission (verdict: Runtime Error):
n, k, x, y = map(int, input().split())
print(min(n, k)* x + max(0, n - k) * y);


Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
print(min(n, k)* x + max(0, n - k) * y);
Buggy python submission (verdict: Runtime Error):
n = int(inpput())
a = [int(x) for x in input().split()]
a.sort(reverse=True)
ans = 0
ans += a[0]
for i in range(2,n):
  ans += min(a[i-1],a[i-2])
print(ans)

Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]
a.sort(reverse=True)
ans = 0
for i in range(1,n):
  ans += a[i//2]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# 競プロの数学は高校数学みたいな泥臭いのが多い
# めんどくさがってA,Bの範囲を計算しなかったのが原因
# なんなら大雑把にみて -1000~1000でもいけてる
X = int(input())
for i in range(2000):
    for j in range(2000):
        a = i-1000
        b = j-1000
        if X == a**5-b**5:
            print(a, end=" ")
            print(b)
            break

Fixed submission:
# 競プロの数学は高校数学みたいな泥臭いのが多い
# めんどくさがってA,Bの範囲を計算しなかったのが原因
# なんなら大雑把にみて -500~500でもいけてる
flag = 0
X = int(input())
for i in range(1000):
    for j in range(1000):
        a = i-500
        b = j-500
        if X == a**5-b**5:
            print(a, end=" ")
            print(b)
            flag =  1
            break
    if flag == 1:
        break
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

ans = 0
for i in range(N):
    if i!= N-1:
        for j in range(N-i-1):
            if (N-j-1)-i == A[i] + A[N-j-1]:
                ans += 1

print(ans)                

Fixed submission:
# 二分探索モジュール bisect
# 添字はiとjの分で相殺(本当の添字は+1が必要だが[(i+1)-(j+1)]なのでいらない(以下は式変形))
import bisect
N = int(input())
A = list(map(int, input().split()))
X = [A[i]+i for i in range(N)]
Y = [j - A[j] for j in range(N)]
ans = 0
Y.sort()
for i in range(N):
    ans += bisect.bisect_right(Y,X[i]) - bisect.bisect_left(Y,X[i])
print(ans)


'''
bisect 二分探索モジュール
A = [1,1,3,3,3,4,5,6]
B = 3
bisect.bisect_left(A, b) 配列Aにbが左から何番目に入るかを返す #2
bisect.bisect_right(A,b) 配列Aにbが右から何晩目に入るかを返す #5
'''
Buggy python submission (verdict: Runtime Error):
import math
X, Y = map(int, input().split())
n = (((X+Y)/3)+Y-X)/2
m = n+X-Y

if n % 1 != 0 or n<0:
    ans = 0

else:
    q = n+m
    p = math.factorial(q) % (10**9+7)
    N = math.factorial(n) % (10**9+7)
    M = math.factorial(m) % (10**9+7)
    ans = p/(N*M)
    ans = ans % (10**9+7)

print(ans//1)

Fixed submission:
import math
X, Y = map(int, input().split())
p = (((X+Y)/3)+Y-X)/2
m = p+X-Y


def framod(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
    return a

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

def comb(n, k, mod):
    a=framod(n, mod)
    b=framod(k, mod)
    c=framod(n-k, mod)
    return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod


if p % 1 != 0 or p<0 or m<0:
    ans = 0

else:
    q = p+m
    q = int(q)
    p = int(p)
    ans = comb(q,p,10**9+7)
  

print(ans)
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
ans = N-1
n = math.sqrt(N)
n = int(n)+1
for i in range(1, n)
    if N%i==0:
        tmp = N//i
        ans = (tmp-1)+(i-1)

    
print(ans)
        


Fixed submission:
import math
N = int(input())
ans = N-1
n = math.sqrt(N)
n = int(n)+1
for i in range(1, n):
    if N%i==0:
        tmp = N//i
        ans = (tmp-1)+(i-1)

    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = N-1
fi = (N)//2
for i in range(1,fi):
    if N%i==0:
        a= N//i
        tmp = (i-1)+(a-1)
        if ans > tmp:
            ans =tmp
print(ans)


Fixed submission:
import math
N = int(input())
ans = N-1
n = math.sqrt(N)
n = int(n)+1
for i in range(1, n):
    if N%i==0:
        tmp = N//i
        ans = (tmp-1)+(i-1)

    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N):
    L1 = L[i]
    for j in range(i+1, N):
        L2 = L[j]
        sumL = L1 + L2
        for k in range(j+1, N):
                if L[k] < sumL:
                    ans += 1
                else:
                    break

print(ans)

Fixed submission:
from bisect import bisect_left # 左から何番目に入るかを二分探索（O(logN)）で返す
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N):
    L1 = L[i]
    for j in range(i+1, N):
        L2 = L[j]
        sumL = L1 + L2
        k = bisect_left(L, sumL)
        ans += max(0, k-j-1) # (k-1)-(j+1)+1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = list(map(int, input().split()))
ans = 0
for i in range(N):
    for j in range(i+1, N):
        for k in range(j+1, N):
                L1 = L[i]
                L2 = L[j]
                L3 = L[k]
                if L1<L2+L3 and L2<L1+L3 and L3<L1+L2:
                    ans += 1
print(ans)

Fixed submission:
from bisect import bisect_left # 左から何番目に入るかを二分探索（O(logN)）で返す
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N):
    L1 = L[i]
    for j in range(i+1, N):
        L2 = L[j]
        sumL = L1 + L2
        k = bisect_left(L, sumL)
        ans += max(0, k-j-1) # (k-1)-(j+1)+1

print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
N = len(S)
ans = 'Yes'

for i in range(N):
    if S[2*i] == 'R':
        ans = 'No'
        break
    elif S[2*i+1] == 'L':
        ans ='No'
        break

print(ans)



Fixed submission:
S = input()
N = len(S)
ans = 'Yes'

for i in range(N):   
    if S[i] == 'R' and (i+1)%2 == 0:
        ans = 'No'
        break
    elif S[i] == 'L' and (i+1)%2 == 1:
        ans ='No'
        break

print(ans)

Buggy python submission (verdict: Runtime Error):
S = input()
N = len(S)

for i in range(N):
    if S[2*i] == 'R':
        print('No')
        break
    else S[2*i+1] == 'L':
        print('No')
        break

print('Yes')

Fixed submission:
S = input()
N = len(S)
ans = 'Yes'

for i in range(N):   
    if S[i] == 'R' and (i+1)%2 == 0:
        ans = 'No'
        break
    elif S[i] == 'L' and (i+1)%2 == 1:
        ans ='No'
        break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):

#アルゴリズムはあってるがLTE
N = int(input())
wordl = []

for i in range(N):
    w = input()
    wl = []
    for j in range(10):
        wl.append(w[j])
    wl.sort()
    w2 = ' '
    for p in range(10):
        w2 += wl[p]
    wordl.append(w2)
wordl.sort()
#print(wordl)

ans = 0
for k in range(N):
    for q in range(k+1,N):
        if wordl[k] == wordl[q]:
            ans += 1
        else:
            break

print(ans)


Fixed submission:
N = int(input())
wordl = {}
ans = 0

for i in range(N):
    w = input()
    wl = []
    for j in range(10):
        wl.append(w[j])
    wl.sort()
    w2 = ' '
    for p in range(10):
        w2 += wl[p]
    if w2 in wordl:
        ans += wordl[w2]
        wordl[w2] += 1
    else:
        wordl[w2] = 1

print(ans)

'''
#アルゴリズムはあってるがLTE
N = int(input())
wordl = []

for i in range(N):
    w = input()
    wl = []
    for j in range(10):
        wl.append(w[j])
    wl.sort()
    w2 = ' '
    for p in range(10):
        w2 += wl[p]
    wordl.append(w2)
wordl.sort()
#print(wordl)

ans = 0
for k in range(N):
    for q in range(k+1,N):
        if wordl[k] == wordl[q]:
            ans += 1
        else:
            break

print(ans)
'''

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
wordl = []

for i in range(N):
    w = input()
    wl = []
    for j in range(10):
        wl.append(w[j])
    wl.sort()
    w2 = ' '
    for p in range(10):
        w2 += wl[p]
    wordl.append(w2)
wordl.sort()
#print(wordl)

ans = 0
for k in range(N):
    for q in range(k+1,N):
        if wordl[k] == wordl[q]:
            ans += 1

print(ans)

Fixed submission:
N = int(input())
wordl = {}
ans = 0

for i in range(N):
    w = input()
    wl = []
    for j in range(10):
        wl.append(w[j])
    wl.sort()
    w2 = ' '
    for p in range(10):
        w2 += wl[p]
    if w2 in wordl:
        ans += wordl[w2]
        wordl[w2] += 1
    else:
        wordl[w2] = 1

print(ans)

'''
#アルゴリズムはあってるがLTE
N = int(input())
wordl = []

for i in range(N):
    w = input()
    wl = []
    for j in range(10):
        wl.append(w[j])
    wl.sort()
    w2 = ' '
    for p in range(10):
        w2 += wl[p]
    wordl.append(w2)
wordl.sort()
#print(wordl)

ans = 0
for k in range(N):
    for q in range(k+1,N):
        if wordl[k] == wordl[q]:
            ans += 1
        else:
            break

print(ans)
'''
Buggy python submission (verdict: Runtime Error):
import math
N, K = map(int, input().split(" "))
mod = 10**9 + 7
#p = (N-K+1)!*(K-1)!
p = math.factorial(N-K+1) * math.factorial(K-1)

for j in range(K):
    i = j+1
    #q=i!*(N-K+1+i)!*(K-i)!*(i-1)!
    q = math.factorial(i) * math.factorial(N-K+1-i) * math.factorial(K-i) * math.factorial(i-1)
    a=int((p/q)%mod)
    print(a)


Fixed submission:
S = input()
Slist=[]
for i in range(4):
    Slist.append(S[i])
Slist.sort()

if Slist[0] == Slist[1] and Slist[2] == Slist[3] and Slist[0]!=Slist[2]:
    ans = "Yes"
else:
    ans = "No"
print(ans)