Harryxun/stf_run huggingface dataset:
T = list(input())
N = len(T)
if T[-1] == "?":
    T[-1] = "D"

if N == 1 and T[0] == "?":
    T[0] = D
elif N == 2:
    if T[0] == "?" and T[1] == "?":
        T[0] = "P"
        T[1] = "D"
                
    elif T[0] == "?" and T[1] == "D":
        T[0] = "P"
                
    elif T[0] == "?" and T[1] == "P":
        T[0] = "D"
        
    elif T[0] == "P" and T[1] == "?":
        T[1] = "D"
elif N > 2:        
    if T[0] == "?" and T[1] == "?":
        T[0] = "P"
        T[1] = "D"
          
    elif T[0] == "?" and T[1] == "D":
        T[0] = "P"
            
    elif T[0] == "?" and T[1] == "P":
        T[0] = "D"
            
    elif T[0] == "D" and T[1] == "?" and T[2] == "D":
        T[1] = "P"
            
    elif T[0] == "D" and T[1] == "?" and T[2] == "P":
        T[1] = "D"
    
    elif T[0] == "P" and T[1] == "?":
        T[1] = "D"
        
    for i in range(2,N-1):
         if T[i-2] == "P" and T[i-1] == "D" and T[i+1] == "D" and T[i] == "?":
             T[i] = "P"
              continue
        elif T[i] == "?":
            T[i] = "D"
        

ans = "".join(T)         
print(ans)


### FIXED CODE ###

T = list(input())
N = len(T)
if T[-1] == "?":
    T[-1] = "D"

if N == 1 and T[0] == "?":
    T[0] = D
elif N == 2:
    if T[0] == "?" and T[1] == "?":
        T[0] = "P"
        T[1] = "D"
                
    elif T[0] == "?" and T[1] == "D":
        T[0] = "P"
                
    elif T[0] == "?" and T[1] == "P":
        T[0] = "D"
        
    elif T[0] == "P" and T[1] == "?":
        T[1] = "D"
        
elif N > 2:        
    if T[0] == "?" and T[1] == "?":
        T[0] = "P"
        T[1] = "D"
          
    elif T[0] == "?" and T[1] == "D":
        T[0] = "P"
            
    elif T[0] == "?" and T[1] == "P":
        T[0] = "D"
            
    elif T[0] == "D" and T[1] == "?" and T[2] == "D":
        T[1] = "P"
            
    elif T[0] == "D" and T[1] == "?" and T[2] == "P":
        T[1] = "D"
    
    elif T[0] == "P" and T[1] == "?":
        T[1] = "D"
        
    for i in range(2,N-1):
        if T[i-2] == "P" and T[i-1] == "D" and T[i+1] == "D" and T[i] == "?":
            T[i] = "P"
            continue
        
        elif T[i] == "?":
            T[i] = "D"
        

ans = "".join(T)         
print(ans)
import collections

a = list(map(int,input().split()))
c = []
d = []
for i in range(a[2]):
    b = list(map(int,input().split()))
    c.append(b[0])
    d.append(b[1])

ans1 = 0
ans2 = 0

e = collections.Counter(c)
f = collections.Counter(d)
g = e.most_common()[0][0]
gc = e.most_common()[0][1]
h = f.most_common()[0][0]
hc = f.most_common()[0][1]

ans1 += gc
ans2 += hc

for i in range(a[0]):
    if c[i] == g:
        c[i] = -1
    if d[i] == h:
        d[i] = -1    

e = collections.Counter(c)
f = collections.Counter(d)
g = e.most_common()[0][0]
gc = e.most_common()[0][1]
h = f.most_common()[0][0]
hc = f.most_common()[0][1]

if g == '-1':
    if gc == h:
        gc = 0
    else:
        g = e.most_common()[1][0]
        gc = e.most_common()[1][1]
if h == '-1':
    if hc == h:
        hc = 0
    else:
        h = f.most_common()[1][0]
        hc = f.most_common()[1][1]

ans1 += gc
ans2 += hc

if ans1 > ans2:
    print(str(ans1))
else:
    print(str(ans2))

### FIXED CODE ###

import collections
import copy

a = list(map(int,input().split()))
c = []
d = []
for i in range(a[2]):
    b = list(map(int,input().split()))
    c.append(b[0])
    d.append(b[1])

ans1 = 0
ans2 = 0

cp = copy.copy(c)
dp = copy.copy(d)

e = collections.Counter(c)
f = collections.Counter(d)
g = e.most_common()[0][0]
gc = e.most_common()[0][1]
h = f.most_common()[0][0]
hc = f.most_common()[0][1]
ans1 += gc
ans2 += hc
for i in range(a[2]):
    if cp[i] == g:
        d[i] = -1
    if dp[i] == h:
        c[i] = -1
e = collections.Counter(c)
f = collections.Counter(d)
g = e.most_common()[0][0]
gc = e.most_common()[0][1]
h = f.most_common()[0][0]
hc = f.most_common()[0][1]

if g == -1:
    if gc == a[2]:
        gc = 0
    else:
        g = e.most_common()[1][0]
        gc = e.most_common()[1][1]
if h == -1:
    if hc == a[2]:
        hc = 0
    else:
        h = f.most_common()[1][0]
        hc = f.most_common()[1][1]

ans1 += hc
ans2 += gc
if ans1 > ans2:
    print(str(ans1))
else:
    print(str(ans2))
class Combination:
    def __init__(self, n, mod):
        self.n = n
        self.mod = mod
        self.fac = [1 for i in range(self.n + 1)]
        self.finv = [1 for i in range(self.n + 1)]
        for i in range(2, self.n+1):
            self.fac[i] = (self.fac[i - 1] * i) % self.mod
            self.finv[i] = (self.finv[i-1] * pow(i, -1, self.mod)) % self.mod

    def comb(self, n, m):
        return self.fac[n] * (self.finv[n-m] * self.finv[m] % self.mod) % self.mod
def iparse():
    return list(map(int, input().split()))

if __name__ == "__main__":
    n, a = iparse()
    x = iparse()

    dp = [[[0 for i in range(sum(x) + 10)] for j in range(n + 10)] \
        for k in range(n + 10)]
    dp[0][0][0] = 1
    for i in range(n):
        for j in range(n + 1):
            for k in range(sum(x) + 1):
                if j >= 1 and k - x[i] >= 0:
                    dp[i + 1][j][k] = dp[i][j][k] + dp[i][j - 1][k - x[i]]
                else:
                    dp[i+1][j][k] = dp[i][j][k]
    ans = 0
    for i in range(n):
        ans += dp[n][i + 1][(i+1)*a]
    print(ans)
    


### FIXED CODE ###

class Combination:
    def __init__(self, n, mod):
        self.n = n
        self.mod = mod
        self.fac = [1 for i in range(self.n + 1)]
        self.finv = [1 for i in range(self.n + 1)]
        for i in range(2, self.n+1):
            self.fac[i] = (self.fac[i - 1] * i) % self.mod
            self.finv[i] = (self.finv[i-1] * pow(i, -1, self.mod)) % self.mod

    def comb(self, n, m):
        return self.fac[n] * (self.finv[n-m] * self.finv[m] % self.mod) % self.mod
def iparse():
    return list(map(int, input().split()))

if __name__ == "__main__":
    n, a = iparse()
    x = iparse()

    dp = [[[0 for i in range(sum(x) + 10)] for j in range(n + 10)] \
        for k in range(n + 10)]
    dp[0][0][0] = 1
    for i in range(n):
        for j in range(n + 1):
            for k in range(sum(x) + 1):
                if j >= 1 and k - x[i] >= 0:
                    dp[i + 1][j][k] = dp[i][j][k] + dp[i][j - 1][k - x[i]]
                else:
                    dp[i+1][j][k] = dp[i][j][k]
    ans = 0
    for i in range(n):
        if (i + 1) * a >= sum(x) + 10:
            break
        ans += dp[n][i + 1][(i+1)*a]
    print(ans)
n=int(input())
xymap=[[-1 for j in range(101)] for i in range(101)]
inp=[]
for i in range(n):
    xi,yi,hi=map(int,input().split())
    if hi==0:
        inp.append(xi,yi,hi)
        pass
    else:
            
        for x in range(101):
            for y in range(101):
                a=abs(xi-x)+abs(yi-y)+hi
                if xymap[x][y]==a or xymap[x][y]==-1 :
                    xymap[x][y]=a
                else:
                    xymap[x][y]=-2
flag=0
for x in range(101):
    for y in range(101):
        if xymap[x][y]!=-2:
            print(x,y,xymap[x][y])
            flag=1
if flag==0:
    xymap=[[-1 for j in range(101)] for i in range(101)]
    for i in range(len(inp)):
        for x in range(101):
            for y in range(101):
                if xymap[x][y]==1 or xymap[x][y]==-1 :
                    xymap[x][y]=1
                else:
                    xymap[x][y]=-2
    for x in range(101):
        for y in range(101):
            if xymap[x][y]!=-2:
                print(x,y,xymap[x][y])

### FIXED CODE ###

n=int(input())
xymap=[[-1 for j in range(101)] for i in range(101)]
inlist=[]
for i in range(n):
    xi,yi,hi=map(int,input().split())
    inlist.append([xi,yi,hi])
inlist.sort(key=lambda x :-x[2])
for i in range(n):
    xi,yi,hi=inlist[i]
    if hi==0:
        xymap[xi][yi]=-2
        for x in range(101):
            for y in range(101):
                a=abs(xi-x)+abs(yi-y)+hi
                if xymap[x][y]<=a:
                    pass
                else:
                    xymap[x][y]=-2
    else:
        for x in range(101):
            for y in range(101):
                a=abs(xi-x)+abs(yi-y)+hi
                if xymap[x][y]==a or xymap[x][y]==-1 :
                    xymap[x][y]=a
                else:
                    xymap[x][y]=-2
for x in range(101):
    for y in range(101):
        if xymap[x][y]!=-2:
            print(x,y,xymap[x][y])
import numpy as np

def f(lst):
    return np.cumsum(lst)

s = input()
cnt = 0
s = s.replace('BC', 'D')

x = [0]*len(s)
for i in range(len(s)):
    if s[i]=='A':
        x[i] += 1
x = f(x)

res = 0
for i in range(len(s)):
    if s[i]=='D':
        res += x[i]
print(res)

### FIXED CODE ###

"""Binary Indexed Tree (Fenwick Tree)"""
class BIT:
    def __init__(self, n):
        self.n = n
        
        #BIT木データ
        self.data = [0]*(n+1)
        
        #元配列
        self.el = [0]*(n+1)
    
    """A1~Aiまでの累積和"""
    def Sum(self, i):
        s = 0
        while i > 0:
            s += self.data[i]
            
            #LSB(Least Significant Bit)の獲得:i&(-i)
            i -= i & (-i) 
        return s
    
    """Ai += x"""
    def Add(self, i, x):
        self.el[i] += x
        while i <= self.n:
            self.data[i] += x
            i += i & -i
    
    """Ai ~ Ajまでの累積和"""
    def Get(self, i, j=None):
        if j is None:
            return self.el[i]
        return self.Sum(j) - self.Sum(i)
    
s = input()
s = s.replace('BC', 'D')
mode = 0
res = 0
for i in range(len(s)):
    if s[i] == 'B' or s[i]=='C':
        mode = 0
    elif s[i] == 'A':
        mode += 1
    else:
        res += mode
print(res)
A , B = input ( ).split ( ' ' )
print ( int ( A ) * int ( B ) ) ,
print ( 2 * ( int ( A ) + int ( B ) ) )

### FIXED CODE ###

A , B = map ( int , raw_input ( ).split ( ) )
print A*B , 2* ( A + B )
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a2 = [0]
b2 = [0]
for i in range(n):
    a2.append(a2[i]+a[i])
for i in range(n):
    b2.append(b2[i]+b[i])
ans = 0
for i in range(n):
    if a[i] > k:
        break
    cnt = m
    sm = 0
    while sm < k-a2[i]:
        sm = b2[cnt-1]
        cnt -= 1
    ans = max(cnt, ans)
print(ans)

### FIXED CODE ###

n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a2 = [0]
b2 = [0]
for i in range(n):
    a2.append(a2[i]+a[i])
for i in range(m):
    b2.append(b2[i]+b[i])
ans = 0
cnt = m
for i in range(n+1):
    if a2[i] > k:
        break
    sm = 0
    while b2[cnt] > k-a2[i]:
        cnt -= 1
    ans = max(cnt+i, ans)
print(ans)
a,b=map(int(input().split()))

print('Yes' if 1<=a<=9 and 1<=b<=9 else 'No')

### FIXED CODE ###

a,b=map(int,input().split())

print(a*b if 1<=a<=9 and 1<=b<=9 else -1)
N = int(input())
C = [-1]

prev = -1
for _ in range(N):
    c = int(input())
    if c == prev:
        continue
    else:
        C.append(c)
        prev = c

MOD = 10**9+7
n = len(C)
dp = [0]*(n+1)
last = [-1]*(N+1)
dp[0] = 1
for i in range(1, n+1):
    if last[C[i]] == -1:
        last[C[i]] = i
        dp[i] = dp[i-1]
    else:
        dp[i] = dp[i-1]+dp[last[C[i]]]
        dp[i] %= MOD
        last[C[i]] = i
print(max(dp))


### FIXED CODE ###

N = int(input())
C = [-1]

for _ in range(N):
    c = int(input())
    if c == C[-1]:
        continue
    else:
        C.append(c)

MOD = 10**9+7
dp = 1
prev = [0]*(max(C)+1)

for c in C[1:]:
    dp = (dp+prev[c]) % MOD
    prev[c] = dp
print(dp)
import sys
import bisect


sys.setrecursionlimit(10 ** 6)


class SegTree:

    def __init__(self, N):
        self.N = N
        self.data = [0] * (2 * N)

    def update(self, i, x):
        i += self.N - 1
        self.data[i] = x
        while i > 0:
            i = (i - 1) // 2
            v = self.data[2 * i + 1] + self.data[2 * i + 2]
            self.data[i] = v

    def query(self, a, b, k, l, r):
        if r <= a or b <= l:
            return 0
        if a <= l and r <= b:
            return self.data[k]
        else:
            v = self.query(a, b, 2 * k + 1, l, (l + r) // 2)
            w = self.query(a, b, 2 * k + 2, (l + r) // 2, r)
            return v + w


def main():
    N, D, A = list(map(int, input().split(' ')))
    pw2_N = 1
    while pw2_N < N:
        pw2_N *= 2
    monsters = [list(map(int, input().split(' '))) for _ in range(N)]
    monsters.sort()
    counts = [(h + A - 1) // A for _, h in monsters]
    X = [x for x, _ in monsters]
    diffs = [(counts[i] - counts[i - 1]) if i > 0 else counts[i] for i in range(N)]
    tree = SegTree(pw2_N)
    for i, d in enumerate(diffs):
        tree.update(i, d)
    ans = 0
    for i in range(N):
        ci = tree.query(0, i + 1, 0, 0, pw2_N)
        if ci <= 0:
            continue
        ans += ci
        r = X[i] + 2 * D
        j = bisect.bisect_right(X, r)
        di = tree.query(i, i + 1, 0, 0, pw2_N)
        dj = tree.query(j, j + 1, 0, 0, pw2_N)
        tree.update(i, di - ci)
        tree.update(j, dj + ci)
    print(ans)


if __name__ == '__main__':
    main()

### FIXED CODE ###

import bisect


def main():
    N, D, A = list(map(int, input().split()))
    monsters = [list(map(int, input().split())) for _ in range(N)]
    monsters.sort()
    X = [m[0] for m in monsters]
    # 端から貪欲に攻撃していく
    ans = 0
    damages = [0] * (N + 1)
    for n, monster in enumerate(monsters):
        x, h = monster
        h = max(0, h - damages[n])
        to_n = bisect.bisect_right(X, x + 2 * D)
        cnt = (h + A - 1) // A  # ceil(h / A)
        ans += cnt
        damages[n] += A * cnt
        damages[to_n] -= A * cnt
        damages[n + 1] += damages[n]
    print(ans)


if __name__ == '__main__':
    main()
N, M, Q = map(int,input().split())
Mlist = [input().split() for l in range(M)]
Qlist = [input().split() for l in range(Q)]
Mlist.sort()
for i in range(len(Mlist)):
    for j in range(len(Mlist[i])):
        Mlist[i][j] = int(Mlist[i][j])
for i in range(len(Qlist)):
    for j in range(len(Qlist[i])):
        Qlist[i][j] = int(Qlist[i][j])
p = [[0 for i in range(10)] for j in range(10)]
q = 0
def count(k,l):
    s = k
    j = l
    p[s-1][j-1] = p[s-1][j-1] + 1
for i in range(len(Mlist)):
    count(Mlist[i][0],Mlist[i][1])
for i in range(len(Qlist)):
    q = 0
    for j in range(Qlist[i][0],Qlist[i][1]+1):
        for k in range(Qlist[i][0],Qlist[i][1]+1):
            if j <= k:
                if p[j-1][k-1] != 0:
                    q = q+ p[j-1][k-1]
    print(q)

### FIXED CODE ###

N, M, Q = map(int,input().split())
Mlist = []
for i in range(M):
    array = list(map(int, input().strip().split()))
    Mlist.append(array)
Qlist = []
for i in range(Q):
    array = list(map(int, input().strip().split()))
    Qlist.append(array)
p = [[0 for i in range(N)] for j in range(N)]
q = 0
r = [[0 for i in range(N)] for j in range(N)]
def count(k,l):
    s = k
    j = l
    p[s-1][j-1] = p[s-1][j-1] + 1
for i in range(len(Mlist)):
    count(Mlist[i][0],Mlist[i][1])
for i in range(N):
    for j in range(N):
        if i == 0:
            r[i][j] = p[i][j] + r[i][j-1]      
        elif j == 0:
            r[i][j] = p[i][j] +r[i-1][j]
        else:
            r[i][j] = r[i-1][j] + r[i][j-1] - r[i-1][j-1] + p[i][j]
for i in range(len(Qlist)):
    q = 0
    if Qlist[i][0] == 1:
        b = r[Qlist[i][1]-1][Qlist[i][1]-1]
    else:
        b = r[Qlist[i][1]-1][Qlist[i][1]-1] - r[Qlist[i][0]-2][Qlist[i][1]-1]
    print(b)
n = int(input())
cards = []
patterns = ['S', 'H', 'C', 'D']
for i in range n:
	each_card = list(map(str, input().strip()))	
	each_card[1] = int(each_card[1])
	cards.append(each_card)
for p in patterns:
	for r in range(1, 13+1):
		if [p, r] in cards:
			pass
		else:
			pass

### FIXED CODE ###

cards = []
patterns = ['S', 'H', 'C', 'D']

n = int(input())

for p in patterns:
	for i in range(1, 13+1):
		cards.append(p + ' ' + str(i))

for i in range(n):
	cards.remove(input())

for i in range(len(cards)):
	print(cards[i])
# -*- coding:utf-8 -*-

def solve():
    N, Q = list(map(int, input().split()))
    S = input()

    dp = [0]*(N)
    dp[0] = 0
    for i in range(0, N-1):
        if S[i]=="A" and S[i+1]=="C":
            dp[i+1] = dp[i] + 1
        else:
            dp[i+1] = dp[i]
    
    for i in range(Q):
        l, r = list(map(int, input()))
        print(dp[r-1] - dp[l-1])
    
    

if __name__ == "__main__":
    solve()


### FIXED CODE ###

# -*- coding:utf-8 -*-

def solve():
    N, Q = list(map(int, input().split(" ")))
    S = input()
    L, R = [], []
    for i in range(Q):
        l, r = list(map(int, input().split(" ")))
        L.append(l)
        R.append(r)
    
    # 累積話で解く
    accumulations = [0] * N

    for i in range(1, N):
        if S[i-1]+S[i] == "AC":
            accumulations[i] = accumulations[i-1] + 1
        else:
            accumulations[i] = accumulations[i-1]

    for i in range(Q):
        if L[i]-1 == 0:
            print(accumulations[R[i]-1])
            continue
        else:
            print(accumulations[R[i]-1] - accumulations[L[i]-1])
            continue


if __name__ == "__main__":
    solve()
x1, y1, x2, y2 = map(int, input().split())
print('%.8f' % (((x2 - x1)**2 + (y2 - y1)**2))**0.5)


### FIXED CODE ###

x1, y1, x2, y2 = map(float, input().split())
print('%.8f' % (((x2 - x1)**2 + (y2 - y1)**2))**0.5)
import sys
N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
Q = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]

QA = [(Q[A[i]], A[i]) for i in range(M)]
QA.sort()

def f(used_q, num):
    if used_q > N:
        return -float("inf")
    elif used_q == N:
        s = sorted(list(str(num)),reverse=True)
        print("".join(s))
        sys.exit()
        return num

    ret = 0
    for qa in QA:
        q = qa[0]
        a = qa[1]
        ret = max(ret,f(used_q + q, num * 10 + a))
    return ret

f(0,0)



### FIXED CODE ###

# N = int(input())
# A = [int(x) for x in input().split()]
# V = [[0] * 100 for _ in range(100)]
# MOD = 10 ** 9 + 7
# メモ化再起
from functools import lru_cache
import sys

sys.setrecursionlimit(100000000)

N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
match = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]



@lru_cache(maxsize=1000000)
def f(n):
    maxval = -float('inf')
    for a in A:
        tmp = n - match[a]
        if tmp == 0:
            maxval = max(maxval, a)
        elif tmp > 0:
            # maxval = max(maxval, f2(f(n - match[a]) * 10 + a))
            maxval = max(maxval, f(n - match[a]) * 10 + a)
    return maxval

@lru_cache(maxsize=1000000)
def f2(n):
    if n < 0:
        return 0
    n = list(str(n))
    n.sort(reverse=True)
    return int("".join(n))

ans = f(N)
print(f2(ans))
# -*- coding: utf-8 -*-
from sys import stdin
from bisect import bisect_left

s_in = lambda: stdin.readline()[:-1]  # s = s_in()
d_in = lambda: int(stdin.readline())  # N = d_in()
ds_in = lambda: list(map(int, stdin.readline().split()))  # List = ds_in()

N = d_in()
A_list = ds_in()

A_list.sort()

ans = 0
while len(A_list) > 1:
    max_a = A_list.pop()
    if bin(max_a)[3:].find('1') == -1:
        if max_a == A_list[-1]:
            A_list.pop()
            ans += 1
    else:
        cand = 2 ** len(bin(max_a)[2:]) - max_a
        idx = bisect_left(A_list, cand)
        if cand == A_list[idx]:
            A_list.pop(idx)
            ans += 1

print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
from sys import stdin
import numpy as np
from collections import Counter

d_in = lambda: int(stdin.readline())  # N = d_in()
ds_in = lambda: list(map(int, stdin.readline().split()))  # List = ds_in()

N = d_in()
A_list = np.array(ds_in())
A_list.sort()
EPSILON = 10**(-6)

cand_A = 2 ** (np.log2(A_list + EPSILON).astype(int) + 1) - A_list
idx = np.searchsorted(A_list, cand_A)
A_count = dict(Counter(A_list))

ans = 0
for i in range(N-1, -1, -1):
    if A_count[A_list[i]] <= 0:
        continue
    A_count[A_list[i]] -= 1
    if (A_list[idx[i]] == cand_A[i]) and (A_count[cand_A[i]] > 0):
        ans += 1
        A_count[cand_A[i]] -= 1

print(ans)
from functools import reduce
from fractions import gcd
from collections import defaultdict,Counter
import copy

n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7

dic = defaultdict(int)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

for i in a:
    c = Counter(prime_factorize(i))
    for j,k in c.items():
        if dic[j] < k:
            dic[j] = k

point = 0

for i in a:
    dic2 = copy.deepcopy(dic)
    e = Counter(prime_factorize(i))
    for j,k in e.items():
        dic2[j] -= k
    now = 1
    for j,k in dic2.items():
        for l in range(k):
            now *= j
            now %= mod
    point += now%mod

print(point%mod)

### FIXED CODE ###

from sys import stdin

n,m = [int(x) for x in stdin.readline().rstrip().split()]

if n == m:
    print("Yes")
else:
    print("No")
x, n, *P = map(int, open(0).read().split())
P = set(P)
for i in range(51):
    Q = {x-i, x+i} - P
	if Q:
		print(min(Q))
		break

### FIXED CODE ###

x, n, *P = map(int, open(0).read().split())
A = list(range(102))
P = set(P)
B = []
m = 10**4
for a in A:
    if a not in P:
        if abs(x-a) < m:
            m = abs(x-a)
            B.append((m, a))
B.sort()
print(min([k for v, k in B if v == B[0][0]]))
N = int(input())
A = list(map(int,input().split()))
A.sort()
total = 1
for i in range(N):
    total *= A[i]
    if 10 ** 18 < total:
        break

if 10**18 < total:
    print("-1")
else:

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
total = 1
if 0 < A.count(0):
    print(0)
else:
    for i in range(N):
        total *= A[i]
        if 10 ** 18 < total:
            break
    if 10**18 < total:
        print("-1")
    else:
        print(total)
C = []
A = input()
for i in A:
    if i == '0':
        C.append(i)
    if i == '1':
        C.append(i)
    if i == 'B':
        C.pop()

print(C)

### FIXED CODE ###

C = []
A = input()
for i in A:
    if i == '0':
        C.append(i)
    if i == '1':
        C.append(i)
    if i == 'B' and  len(C)!=0:
        C.pop()
    else: pass

print("".join(C))
import numpy as np
from scipy.sparse.csgraph import floyd_warshall
n = int(input())
a = np.array([[int(i) for i in input().split()] for i in range(n)])
d,ans = floyd_warshall(a,directed=False),0
if any(a[i][j]!=d[i][j] for i in range(n) for j in range(n)): ans = -1
else:
	inf = float("inf")
	for i in range(n): a[i][i] = inf
	for i in range(n):
		for j in range(i+1,n):
			num = np.min(a[i]+a[j])
			if num>a[i][j]: ans+=a[i][j]
print(int(ans))

### FIXED CODE ###

import numpy as np
from scipy.sparse.csgraph import floyd_warshall
n = int(input())
a = np.array([[int(i) for i in input().split()] for i in range(n)])
d,ans = floyd_warshall(a,directed=False),0
if any(a[i][j]!=d[i][j] for i in range(n) for j in range(n)): ans = -1
else:
	inf = 10**10
	for i in range(n): a[i][i] = inf
	for i in range(n):
		for j in range(i+1,n):
			num = np.min(a[i]+a[j])
			if num>a[i][j]: ans+=a[i][j]
print(int(ans))
n = input() + 1
for val in range(1,n):
	x = map(float,raw_input().split(' '))
	if (x[0]-x[2])/(x[1]-x[3]) == (x[4]-x[6])/(x[5]-x[7]):
		print 'YES'
	else:
		print 'NO'

### FIXED CODE ###

n = input() + 1
for val in range(1,n):
	x = map(float,raw_input().split(' '))
	if x[1]-x[3] == 0 and x[5]-x[7] == 0:
			print 'YES'
	elif x[1]-x[3] != 0 and x[5]-x[7] == 0:
			print 'NO'
	elif x[1]-x[3] == 0 and x[5]-x[7] != 0:
			print 'NO'
	else:
		if (x[0]-x[2])/(x[1]-x[3]) == (x[4]-x[6])/(x[5]-x[7]):
			print 'YES'
		else:
			print 'NO'