Problem:


Score : 100 points

Problem Statement

You are given a 4-character string S consisting of uppercase English letters.
Determine if S consists of exactly two kinds of characters which both appear twice in S.

Constraints

The length of S is 4.

S consists of uppercase English letters.

Input

Input is given from Standard Input in the following format:

S

Output

If S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.

Sample Input 1

ASSA

Sample Output 1

Yes

S consists of A and S which both appear twice in S.

Sample Input 2

STOP

Sample Output 2

No

Sample Input 3

FFEE

Sample Output 3

Yes

Sample Input 4

FREE

Sample Output 4

No



Sample input:
ASSA


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
S = input()

if len(set(S)) == 2:
  if S.count(S[0]) == 2:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s=input()

if (s[0]==s[2] and s[1]==s[3]) or (s[0]==s[1] and s[2]==s[3]) or (s[0]==s[3] and s[1]==s[2]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()

if (s[0]==s[2] and s[1]==s[3]) or (s[0]==s[1] and s[2]==s[3]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

""" Input
N = int(input())
N, A, B = map(int, input().split())
A = list(map(int, input().split()))
A = np.array(input().split(), dtype=np.float64)
D = [int(input()) for _ in range(N)]
AB = [[int(x) for x in input().split()] for _ in range(N)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]
"""

S = input().rstrip()
S = sorted(S)
if S[0] == S[1] and S[2] == S[3]:
    print('Yes')
else:
    print('No')





# def main():

# if __name__ == '__main__':
#     main()

Submission status: Wrong Answer

Solution code:
S = sorted(input())

if S[0]==S[1] and S[2]==S[3]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
a = s[0]
b = s[1]
c = s[2]
d = s[3]
if a==b:
    if c==d:
        if a!=c: print("Yes")
        else: print("No")
    else: print("No")
elif a==d:
    if b==c: print("Yes")
elif a==c:
    if b==d: print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
s = input()
a = s[0]
b = s[1]
c = s[2]
d = s[3]
if a==b:
    if c==d:
        if a!=c: print("Yes")
        else: print("No")
    else: print("No")
elif a==d:
    if b==c: print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
s = input()
a = s[0]
b = s[1]
c = s[2]
d = s[3]
if a==b:
    if c==d:
        if a!=c: print("Yes")
elif a==d:
    if b==c: print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
S = input()
ans = False
if S[0] == S[1]:
    ans = (S[2] == S[3])
elif S[0] == S[2]:
    ans = (S[1] == S[3])
elif S[0] == S[3]:
    ans = (S[1] == S[2])
print("Yes" if ans else "No")

Submission status: Wrong Answer

Solution code:
S = input()

if S[0]==S[1]:
    if S[2]==S[3]:
        print("Yes")
    else:
        print("No")
elif S[0]==S[2]:
    if S[1]==S[3]:
        print("Yes")
    else:
        print("No")
elif S[1]==S[2]:
    if S[0]==S[3]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = str(input())

print('Yes') if (s[0]==s[1] and s[2]==s[3]) or (s[0]==s[2] and s[1]==s[3]) or (s[0]==s[3] and s[1]==s[2]) else print('No')

Submission status: Wrong Answer

Solution code:
l = list(input())
l.sort()
if l[1]==l[0] and l[2]==l[3]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a = input()
x = 0
y=0
for i in range(4):
    if a[i-1]!=a[i]:
        x+=1
    else:
        y+=1
if x==2 and y==2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A=input()
if A[0]==A[1] and A[2]==A[3]:
  print("Yes")
elif A[1]==A[2] and A[0]==A[3]:
  print("Yes")
elif A[0]==A[2] and A[1]==A[3]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = input()
A = S[0]
B = S[1]
C = S[2]
D = S[3]

if A == B and C ==D and A != C:
  print("Yes")
elif A == C and B ==D and A != C:
  print("Yes")
elif A == D and B == C and A != B:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = input()
flag = False

if S.count(S[0]) == 2:
  S.strip(S[0])
  if S.count(S[0]) == 2:
    flag = True

if flag == True:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
if len(set(s))==2 and (s[0]==s[1] and s[2]==s[3]) or (s[0]==s[2] and s[1]==s[3]) or (s[0]==s[3] and s[1]==s[2]):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
if (s[0]==s[1] and s[2]==s[3]) or (s[0]==s[2] and s[1]==s[3]) or (s[0]==s[3] and s[1]==s[2]):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
# 文字列を取得
s = input()

# バラバラにして並び替え
slist = list(s)
slist.sort()
print(slist)

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

Submission status: Wrong Answer

Solution code:
s = input()

s[:1]
s[1:2]
s[2:3]
s[3:4]

if s[:1] == s[1:2]:
    if s[:1] == s[2:3] or s[:1] == s[3:4]:
        print("No")
    elif s[1:2] == s[2:3] or s[1:2] == s[3:4]:
        print("No")
    elif s[2:3] == s[3:4]:
        print("Yes")

elif s[:1] == s[2:3]:
    if s[:1] == s[1:2] or s[:1] == s[3:4]:
        print("No")
    elif s[2:3] == s[1:2] or s[2:3] == s[3:4]:
        print("No")
    elif s[1:2] == s[3:4]:
        print("Yes")

elif s[:1] == s[3:4]:
    if s[:1] == s[1:2] or s[:1] == s[2:3]:
        print("No")
    elif s[3:4] == s[1:2] or s[3:4] == s[2:3]:
        print("No")
    elif s[1:2] == s[2:3]:
        print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()

s[:1]
s[1:2]
s[2:3]
s[3:4]

if s[:1] == s[1:2]:
    if s[:1] == s[2:3] or s[:1] == s[3:4]:
        print("No")
    elif s[1:2] == s[2:3] or s[1:2] == s[3:4]:
        print("No")
    elif s[2:3] == s[3:4]:
        print("Yes")

if s[:1] == s[2:3]:
    if s[:1] == s[1:2] or s[:1] == s[3:4]:
        print("No")
    elif s[2:3] == s[1:2] or s[2:3] == s[3:4]:
        print("No")
    elif s[1:2] == s[3:4]:
        print("Yes")

if s[:1] == s[3:4]:
    if s[:1] == s[1:2] or s[:1] == s[2:3]:
        print("No")
    elif s[3:4] == s[1:2] or s[3:4] == s[2:3]:
        print("No")
    elif s[1:2] == s[2:3]:
        print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()

s[:1]
s[1:2]
s[2:3]
s[3:4]

if s[:1] == s[1:2]:
    if s[:1] == s[2:3] or s[:1] == s[3:4]:
        print("No")
    elif s[1:2] == s[2:3] or s[1:2] == s[3:4]:
        print("No")
    elif s[2:3] == s[3:4]:
        print("Yes")

if s[:1] == s[2:3]:
    if s[:1] == s[1:2] or s[:1] == s[3:4]:
        print("No")
    elif s[2:3] == s[1:2] or s[2:3] == s[3:4]:
        print("No")
    elif s[1:2] == s[3:4]:
        print("Yes")

if s[:1] == s[3:4]:
    if s[:1] == s[1:2] or s[:1] == s[2:3]:
        print("No")
    elif s[3:4] == s[1:2] or s[3:4] == s[2:3]:
        print("No")
    elif s[1:2] == s[2:3]:
        print("Yes")

Submission status: Wrong Answer

Solution code:
S = list(str(input()))
if (S[0]==S[1]) and (S[2]==S[3]):
    print('Yes')
elif (S[0]==S[2]) and (S[1]==S[3]):
    print('Yes')
elif (S[0]==S[3]) and (S[1]==S[2]):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
a = input()

if a[0] == a[1] and a[2] == a[3]:
    print("Yes")
elif a[0] == a[2] and a[1] == a[3]:
    print("Yes")
elif a[0] == a[3] and a[1] == a[2]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=sorted(list(input()))
if S[0]==S[1] and S[2]==S[3]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import collections
s = str(input())
l = []
for i in range(0,4):
  l.append(s[i])
  i += 1
c = collections.Counter(l)
print(len(c))

Submission status: Wrong Answer

Solution code:
S=input()
a=S[0]
flag=False
b=""
for i in range(4):
  if(S[i]!=a and b==""):
    flag=True
    b=S[i]
  if(S[i]!=a and S[i]!=b and flag==True):
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
a,b,c,d = input()
listo = [a,b,c,d]
listo.sort()
if (listo[0]==listo[1])and(listo[2]==listo[3]) : print("Yes")
else : print("No")

Submission status: Wrong Answer

Solution code:
S=input()

if(S[0]==S[1] and S[2]==S[3]):
    print("Yes")

elif(S[0]==S[2] and S[1]==S[3]):
    print("Yes")

elif(S[0]==S[3] and S[1]==S[2]):
    print("Yes")

elif(S[0]==S[1]==S[2]==S[3]):
    print("No")
    
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()

if(S[0]==S[1] and S[2]==S[3]):
    print("Yes")

elif(S[0]==S[2] and S[1]==S[3]):
    print("Yes")

elif(S[0]==S[3] and S[1]==S[2]):
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")


s=input()

if s[0] == s[1] and s[2] == s[3]:
    print('Yes')
elif s[0] == s[2] and s[1] == s[3]:
    print('Yes')
elif s[0] == s[3] and s[2] == s[1]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S=str(input())
if S[0]==S[1] and S[2]==S[3]:
  print('Yes')
elif S[0]==S[2] and S[1]==S[3]:
  print('Yes')
elif S[0]==S[3] and S[1]==S[2]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = list(input())
S.sort()

if S[0] == S[1] and S[2] == S[3]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S=sorted(input())
if S[0]==S[1] and S[2]==S[3] and S[0]!=2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
if S[0] == S[1] and S[2] == S[3]:
    print('Yes')
elif S[0] == S[2] and S[1] == S[3]:
    print('Yes')
elif S[0] == S[3] and S[1] == S[2]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S=list(map(str,input()))
S.sort()
if S[0]==S[1] and S[2]==S[3]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=list(map(str,input()))
cnt1=0
cnt2=0
if S[0]!=S[1]:
    for i in range(1,4):
        if S[0]==S[i]:
            cnt1 +=1
            break
    for j in range(2,4):
        if S[1]==S[j]:
            cnt2 +=1
            break
    if cnt1==1 and cnt2==1:
        print("Yes")
    else:print("No")
elif S[0]==S[1] and S[2]==S[3]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=list(map(str,input()))
cnt1=0
cnt2=0
if S[0]!=S[1]:
    for i in range(1,4):
        if S[0]==S[i]:
            cnt1 +=1
            break
    for j in range(2,4):
        if S[1]==S[j]:
            cnt2 +=1
            break
    if cnt1==1 and cnt2==1:
        print("Yes")
    else:print("No")
else:
    if S[2]==S[3]:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
S=list(map(str,input()))
cnt1=0
cnt2=0
if S[0]!=S[1]:
    for i in range(1,4):
        if S[0]==S[i]:
            cnt1 +=1
    for j in range(2,4):
        if S[1]==S[j]:
            cnt2 +=1
    if cnt1==1 and cnt2==1:
        print("Yes")
    else:print("No")
else:
    if S[2]==S[3]:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
s=input()
print("Yes" if ((s[0]==s[1] and s[2]==s[3]) or
   (s[0]==s[2] and s[1]==s[3]) or
   (s[0]==s[3] and s[1]==s[2])) else "No")

Submission status: Wrong Answer

Solution code:
s = input()
if set(s[:2]) == set(s[2:]): print('Yes')
elif s[0] == s[3] and s[1] == s[2]: print('Yes')
elif s[0]==s[1] and s[2]==s[3]:print('Yes')
else:print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
print('YNeos'[set(s[:2])!=set(s[2:])::2])

Submission status: Wrong Answer

Solution code:
S = str(input())
L = sorted (S)
if L[0] == L[1] and L[2] == L[3] :
    print ('Yes')
else:
    print ('No')

Submission status: Wrong Answer

Solution code:
S = str(input())
L = sorted (S)
if L[0] == L[1] and L[2] == L[3] :
    print ('yes')
else:
    print ('No')

Submission status: Wrong Answer

Solution code:
s = str(input())
l = sorted (s)
if l[0] == l[1] and l[2] == l[3]:
    print ('yes')
else:
    print ('No')

Submission status: Wrong Answer

Solution code:
s = input()
if len(set(s))==2:
    if len(s.strip(s[0]))==2:
        print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = str(input())
x = {}
for i in range(4):
  if s[i] not in x.keys():
    x[s[i]] = 1
  else:
    x[s[i]] += 1
for i in x.items():
  if i != 2:
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
if s[0]==s[1] and s[0]==s[2] and s[2]==s[3]:
    print("Yes")
elif s[0]==s[2] and s[0]==s[1] and s[1]==s[3]:
    print("Yes")
elif s[0]==s[3] and s[0]==s[1] and s[1]==s[2]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
if s[0]+s[1] == s[3]+s[2]: print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
s=input()
if (s[0]==s[1] and s[2]==s[3]) or (s[0]==s[2] and s[1]==s[3]) or (s[0]==s[3] and s[1]==s[2]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()
if S[0]!=S[2] or S[0]!=S[3]:
    if S[0]==S[1] and S[2]==S[3]:
        print('YES')
    elif S[0]==S[3] and S[2]==S[1]:
        print('YES')
    elif S[0]==S[2] and S[3]==S[1]:
        print('YES')
    else:
        print('NO')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
S=input()
if S[0]!=S[2] or S[0]!=S[3]:
    if S[0]==S[1] and S[2]==S[3]:
        print('YES')
    elif S[0]==S[3] and S[2]==S[1]:
        print('YES')
    elif S[0]==S[2] and S[3]==S[1]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=input()
if s[0]==s[1]:
  if s[2]==s[3]:
    print("Yes")
  else:print("No")
elif s[0]==s[2]:
  if s[1]==s[3]:
    print("Yes")
  else:print("No")    
elif s[0]==s[3]:
  if s[1]==s[2]:
    print("Yes")
  else:print("No")

Submission status: Wrong Answer

Solution code:
S = sorted(str(input()))
if S[0] == S[1] and S[2] == S[3]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a=input()
total_a = 0
if a[0] == a[1] and a[2] == a[3]:
    total_a +=1
elif a[0] == a[3] and a[2] == a[1]:
    total_a +=1
else:
    print('No')

if total_a == 1:
    print('Yes')

Submission status: Wrong Answer

Solution code:
s = [str(input())]

l = []

for i in range(4):
  l.append(ord(s[0][i]))
  
cl = sorted(l)

if cl[0] == cl[1] and cl[2] == cl[3]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S=input()
if (S[0]==S[1] and S[2]==S[3]) or (S[0]==S[2] and S[1]==S[3]) or (S[0]==S[3] and S[2]==S[1]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()
if (S[0]==S[1] and S[2]==S[3]) or (S[0]==S[2] and S[1]==S[3]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import random
a=["Yes","No"]
random.shuffle(a)
print(a[0])

Submission status: Wrong Answer

Solution code:
s = input()
for i in s:
  if s.count(i) != 2:
    print("No")
print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
target = s[0]
target2 = s[1]

if len(set(list(s))) > 2:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s=list(input())
s.sort()
if s[0]==s[1] and s[2]==s[3]:print('Yes')
else:print('No')

Submission status: Wrong Answer

Solution code:
import collections
S = input()
c = collections.Counter(S)

if (len(c.keys()) == 2 )and(c.values() == [2,2]):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S=str(input())
if (S[0]==S[1] and S[2]==S[3]) or (S[0]==S[2] and S[1]==S[3]) or (S[0]==S[3] and S[1]==S[2]):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
#A
s = list(input())
if len(s) != 4:
    print('No')
else:
    s.sort()
    if s[0] == s[1] and s[2] == s[3]:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())

s.sort()

if s[0] == s[1] and s[2] == s[3] and s[1] != s[2]:
   print('yes')

else:
   print('no')

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
S = input()

d = defaultdict(int)

for i in range(len(S)):
    d[S[i]] += 1
f = 0
for i in range(len(S)):
    if d[S[i]] != 2:
        f = 1

if f == 0:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = list(input())
s.sort()
if s[0] == s[1] and s[2] == s[3]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S=input()
if S[0]==S[1]:
    if S[2]==S[3] and S[0]!=S[2]:
        print("Yes")
elif S[0]==S[2]:
    if S[1]==S[3]:
        print("Yes")
elif S[0]==S[3]:
    if S[1]==S[2]:
        print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()
if S[0]==S[1]:
    if S[2]==S[3] and S[0]!=S[2]:
        print("Yes")
    else:
        print("No")
elif S[0]==S[2]:
    if S[1]==S[3]:
        print("Yes")
    else:
        print("No")
elif S[0]==S[3]:
    if S[1]==S[2]:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
s = input()
d = {}
for i in range(len(s)):
    if s[i] not in d:
        d[s[i]] = 1
    else:
        d[s[i]] += 1
ans = 'Yes'
if len(d.keys()) != 2:
    ans = 'No'
for i in d.keys():
    if d[i] != 2:
        ans = 'No'
print(d)
print(ans)

Submission status: Wrong Answer

Solution code:
S=input()
cnt=0
for i in range(4):
  tmp=S[0]
  if S[i]==tmp:
    cnt+=1
if cnt==2:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = input()

if (s[0] == s[1] and s[2] == s[3]) or (s[0] == s[2] and s[1] == s[3]) or (s[0] == s[3] and s[1] == s[2]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def solve():
    S = list(input())
    S.sort()
    ans = 'No'
    if S[0] == S[1] and S[2] == S[3]:
        ans = 'Yes'
    return ans

print(solve())

Submission status: Wrong Answer

Solution code:
s=sorted(input())
print('Yes' if s[:2]==s[2:] else 'No')

Submission status: Wrong Answer

Solution code:
s = input()
s = s.replace(s[0],'').replace(s[1],'').replace(s[2],'')

if s:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
a = str(input())
s = sorted(a)
if s[0] == s[1] and s[2] == s[3] :
    print('Yes')
else :
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()

if s[0]==s[1] and s[2] == s[3]:
    print("Yes")
elif s[0]==s[2] and s[1] == s[3]:
    print("Yes")
elif s[0] == s[3] and s[1] == s[2]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=sorted(input())
print("Yes" if s[0]==s[1]and s[2]==s[3]else"No")

Submission status: Wrong Answer

Solution code:
S = list(input())
S.sort()
if S[0] == S[1] and S[2] == S[3]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
l = input()
 
if l[0]==l[2] and l[1]==l[3]:
  print('Yes')
elif l[0]==l[3] and l[1]==l[2]:
  print('Yes')
elif l[0]==l[1] and l[2]==l[3]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
l = input()

if l[0]==l[2] and l[1]==l[3]:
  print('Yes')
elif l[0]==l[3] and l[1]==l[2]:
  print('Yes')
elif l[0]==l[1] and l[2]==l[3]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a=input()
print('YNeos'[map(a.count,a)!=map(2,a)::2])

Submission status: Wrong Answer

Solution code:
s=input()
if ((s[0]==s[1] and s[2]==s[3]) or (s[0]==s[2]and s[1]==s[3]) or (s[0]==s[3]and s[1]==s[2])):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = input()
S = [i for i in S]

s = sorted(S)

if s[0]==s[1] and s[2]==s[3]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=sorted(input())
print('Yes'if(s[::2]==s[1::2]==s[1:3])else'No')

Submission status: Wrong Answer

Solution code:
s=sorted(input())
print('Yes'if(s[::2]==s[::-2])&(s[0]!=s[-1]
)else'No')

Submission status: Wrong Answer

Solution code:
s = input()
print(set(s))
if len(set(list(s))) == 2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
arr = list(s)
arr.sort()
if arr[0]==arr[1] and arr[1] != arr[2]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s=sorted(input())
if s[0]==s[1]:
  if s[0]!=s[2] and s[2]==s[3]:
    print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
print(["No","Yes"][set(list(input()))==2])

Submission status: Wrong Answer

Solution code:
S = sorted(input())
print('Yes' if S[0] == S[1] and S[2] == S[3] else 'No')

Submission status: Wrong Answer

Solution code:


s = sorted(input())

print("Yes" if s[0] == s[1] and s[2] == s[3] else "No")

Submission status: Wrong Answer

Solution code:


s = sorted(input())

print("Yes" if s[1] == s[1] and s[2] == s[3] else "No")

Submission status: Wrong Answer

Solution code:
s=input()
a=s[0]
b=0
ac=1
bc=1
for i in range(1,4):
    if s[i]!=a:
        if s[i]!=b:
            if b==0:
                b=s[i]
            else:
                break
        else:
            bc-=1
    else:
        ac-=1
print(ac,bc)
if ac==0 and bc==0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
word = input()

if len(word) != 4:
  print('No')
  sys.exit()

if not word.isupper() or not word.isalpha() :
  print('No')
  sys.exit()
    
word_cnt = {}

for s in word:
  if s in word_cnt.keys():
    if word_cnt[s] != 1:
      print('No')
      sys.exit()
    word_cnt[s] += 1
  else:
    word_cnt[s] = 1
  
print('Yes')

Submission status: Wrong Answer

Solution code:
import sys
word = input()

if not word.isupper() or not word.isalpha() :
  print('No')
  sys.exit()
  
word_cnt = {}

for s in word:
  if s in word_cnt.keys():
    if word_cnt[s] != 1:
      print('No')
      sys.exit()
    word_cnt[s] += 1
  else:
    word_cnt[s] = 1
  
print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
if s[0] == s[1] and s[2] == s[3]:
	print('Yes')
elif s[0] == s[2] and s[1] == s[3]:
	print('Yes')
elif s[0] == s[3] and s[1] == s[2]:
  	print('Yes')
else:
	print('No')

Submission status: Wrong Answer

Solution code:
import os, sys, re, math

S = input()

print('Yes' if len(S.replace(S[0], '')) == 2 else 'No')

Submission status: Wrong Answer

Solution code:
s = list(input())

s.sort()

if s[0] == s[1] and s[2] == s[3]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = input()
if S[0] == S[1] and S[2] == S[3]:
    print ("Yes")
elif S[0] == S[2] and S[1] == S[3]:
    print ("Yes")
elif S[0] == S[3] and S[1] == S[2]:
    print ("Yes")
else:
    print ("No")

Submission status: Wrong Answer

Solution code:
s = input()
s=sorted(s)
if s[0] == s[1] and s[2] == s[3]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = [i for i in input()]
s.sort()
if s[0]==s[1] and s[2]==s[3]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = input()
a = S[0]
b = ''
flag = 0
for i in range(1,len(S)):
  if a != b and b=='':
    b = S[i]
  elif a != b:
    flag=1
    
if flag: print("No")
else: print("Yes")

Submission status: Wrong Answer

Solution code:
s=input()
if (s[0]==s[1] and s[2]==s[3]) or (s[0]==s[2] and s[1]==s[3]) or (s[0]==s[3] and s[1]==s[2]):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = input()
S = S.replace(S[0],"")
print(S)

if len(S) > 0:
    S = S.replace(S[0],"")
    if len(S) == 0:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
S = S.strip(S[0])

if len(S) > 0:
    S = S.strip(S[0])
    if len(S) == 0:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N = input()
S = sorted(N)
flag = True
if S[0] != S[1]:
  flag = False
if S[2] != S[3]:
  flag = False
if S[1] == S[2]:
  flag = False
if flag == True:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
N = input()
S = sorted(N)
flag = True
if S[0] != S[1]:
  flag = False
if S[2] != S[3]:
  flag = False
if flag == True:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
s=input()
t=[]
for i in range(4):
  if s[i] in t:
    t.append(t[i])
if len(t)==2:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = str(input())
s = list(S)
s.sort()
if s[0]==s[1] and s[2]==s[3]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = sorted(str(input()))

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

Submission status: Wrong Answer

Solution code:
import collections
s = input()
s = list(s)
s = collections.Counter(s)
s = list(s.values())
flag = False
for i in s:
    if i!=2:
        flag = True
if flag==True:
    print('NO')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
s=str(input().split())
s=sorted(s)
if s[0]==s[1] and s[2]==s[3] and s[1]!=s[2]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
for i in set(s):
    if s.count(i) % 2 == 1:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
s=sorted(input())
if s[0]==s[1] and s[2]==s[3]:print('Yes')
else:print('No')

Submission status: Wrong Answer

Solution code:
s=input()
ans="Good"
for i in range(3):
  if s[i]==s[i+1]:
    ans="Bad"
print(ans)

Submission status: Wrong Answer

Solution code:
s1 = list(input())
s2 = sorted(s1)
if s2[0] == s2[1] and s2[2] == s2[3]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()
s=str(set(s))
if (len(s) != 2):
  print("NO")
else:
  print("YES")

Submission status: Wrong Answer

Solution code:
S=list(input())
print("Yes" if len(sorted(S))==2 else "No")

Submission status: Wrong Answer

Solution code:
S = list(input())
A = sorted(S)
if A[0] == A[1] and A[2] == A[3]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S=input()
d={}
for i in S:
    if i not in d:
        d[i]=1
    else:
        d[i]+=1
v=list(d.values())
if len(d)==2:
    if (v[0]==2)and(v[1]==2):
        print("YES")
    else:
        print("NO")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
s=input()
d={}
for i in s:
    if i not in d:
        d[i]=1
    else:
        d[i]+=1
v=list(d.values())
if len(d)==2:
    if (v[0]==2)and(v[1]==2):
        print("YES")
    else:
        print("NO")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
s=input()
d={}
for i in s:
    if i not in d:
        d[i]=1
    else:
        d[i]+=1
if len(d)==2:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
S = input()
for c in S:
  if c.count != 2:
    print('No')
    exit(0)
print('Yes')

Submission status: Wrong Answer

Solution code:
S=str(input())
count=[]
for i in range(len(S)-1):
    if S[i] not in count:
        count.append(S[i])
if len(count)==2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S=input()
if S[0]==S[1] and S[2]==S[3]:
    print("Yes")
elif S[0]==S[2] and S[1]==S[3]:
    print("Yes")
elif S[0]==S[3] and S[1]==S[2]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()

s_sorted = sorted(s)

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

Submission status: Wrong Answer

Solution code:
    
S = input()
    
s = sorted(S)
    
if [s[0]==s[1] and s[2]==s[3]] and [s[1] != s[2]]:
    print("Yes")
   
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=list(input())
if S[0]==[1] and S[2]==S[3] and S[0]!=S[2] or S[1]!=S[3]:
  print('Yes')
elif S[0]==S[2] and S[1]==S[3] and S[0]!=S[1] or S[2]!=S[3]:
  print('Yes')
elif S[0]==S[3] and S[1]==S[2] and S[0]!=S[1] or S[2]!=S[3]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S=list(input())
if S[0]==[1] and S[2]==S[3] and S[0]!=S[2] and S[1]!=S[3]:
  print('Yes')
elif S[0]==S[2] and S[1]==S[3] and S[0]!=S[1] and S[2]!=S[3]:
  print('Yes')
elif S[0]==S[3] and S[1]==S[2] and S[0]!=S[1] and S[2]!=S[3]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S=list(input())
if S[0]==[1] and S[2]==S[3]:
  print('Yes')
elif S[0]==S[2] and S[1]==S[3]:
  print('Yes')
elif S[0]==S[3] and S[1]==S[2]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S=str(input())
s=list(S)
count=0
tmp=s[0]
tmp2=''
for i in range(len(s)-1):
  if tmp==s[i+1]:
    tmp=''
    s[i+1]=''
  elif tmp!=s[i+1]:
    if tmp2==s[i+1]:
      tmp2=''
      s[i+1]=''
    else:
      tmp2=s[i+1]
#print(s)
#print(len(s))
A=''
for i in range(len(s)):
    A+=(s[i])
if len(A)==2:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = list(input())

if S[0] == S[1] and S[2] == S[3]:
  print("Yes")
elif S[0] == S[2] and S[1] == S[3]:
  print("Yes")
elif S[0] == S[3] and S[1] == S[2]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = input()

S_array = [""] * 4

for i in range(len(S)):
    S_array[i] = S[i]

S_array.sort()

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

Submission status: Wrong Answer

Solution code:
s = list(input())
s = sorted(s)
if s[0] == s[1] and s[2] == s[3] and s[0] != s[1]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
s = sorted(s)
if s[0] == s[1] and s[2] == s[3]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = input()
s_list = list(s)
s_list.sort()

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

Submission status: Wrong Answer

Solution code:
s = input()
sorted(s)

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

Submission status: Wrong Answer

Solution code:
S =input()
listS = [S[0],S[1],S[2],S[3]]
listS.sort()
if listS[0] == listS[1] and listS[2] == listS[3] and listS[2] !=listS[3]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S =input()
listS = [S[0],S[1],S[2],S[3]]
listS.sort()
if listS[0] == listS[1] and listS[2] == listS[3]:
    print('Yes')
else:
    print('No')