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 = str(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')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = input()
match1 = False
match2 = False
thirds = False
if S[0] == S[1]:
    thirds = True
    match1 = True
elif S[0] == S[2] or S[0] == S[3]:
    match1 = True
if match1:
    if thirds == True:
        if S[2] == S[3]:
            match2 = True
    elif S[1] == S[2]:
        match2 = True
if match1 and match2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
has22flg1 = False
is2 = False
issucsess1 = False
issucsess2 = False
for i in range(1,4):
    if S[0] == S[i]:
        if i == 1:
            is2 = True
        issucsess1 = True
for j in range(1,4):
    if is2 == True:
        if S[2] == S[3]:
            issucsess2 = True
    elif S[1] == S[j]:
        issucsess2 = True
if issucsess1 and issucsess2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()

if not s[0] == s[1] and s[1] == s[2] and s[2] == s[3]:
    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")
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 = str(input())
X=[]

for s in S:
    X.append(s)

X = sorted(X)
if (X[0] == X[1]) & (X[2]==X[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[0]!=S[1]):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = list(str(input()))
S1 = list(set(S))
print(S1)
if (len(S1) == 2)and(S.count(S1[0]) == 2)and(S.count(S1[1]) == 2):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = list(str(input()))
S1 = list(set(S))
#print(S1)
if (len(S1) == 2)and(S.count(S1[0]) == 2)and(S.count(S1[1]) == 2):
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
S = list(str(input()))
S1 = list(set(S))
print(S1)
if ((len(S1) == 2)and(S.count(S1[0]) == 2)and(S.count(S1[1]) == 2)):
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
S = list(str(input()))
S1 = list(set(S))

if (len(S1) == 2)and(S.count(S1[0]) == 2)and(S.count(S1[1]) == 2):
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
S = list(str(input()))
S1 = list(set(S))

if (len(S1) == 2)and(S.count(S1[0]) == 2)and(S.count(S1[1])):
  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]:
  ans = "Yes"
else:
  ans = "No"
  
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c,d=input()
if a==b and c==d:
  print('Yes')
elif a==c and b==d:
  print('Yes')
elif a==d and b==c:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
flag = False
num = -1
for i in range(1, 4):
    if S[0] == S[i]:
        num = i
if num != -1:
    for i in range(1, 4):
        if S[i] != S[0] and i != num:
            flag = True
        
if flag == True:
    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:
a,b,c,d=input()
if a==b and c==d or a==c and b==d or a==d and b==c:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
#13:48
S = input()
if S[0] in S[1:4]:
    S.strip(S[0])
    if S[0] in S[1]:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
#13:48
S = input()
if S[0] in S[1:4]:
    if S[1] in S[2:4]:
        print("Yes")
        exit()
    elif S[2] in S[3:4]:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
'''A - Fifty-Fifty
https://atcoder.jp/contests/abc132/tasks/abc132_a

>>> main('ASSA')
Yes
>>> main('STOP')
No
>>> main('FFEE')
Yes
'''


def main(s):
    for _s in s[:1]:
        if s.count(_s) != 2:
            print('No')
            return
    print('Yes')


if __name__ == "__main__":
    main(input())

Submission status: Wrong Answer

Solution code:
s = "".join(sorted(list(input())))
if s.replace(s[0],"").replace(s[2],"") == "":
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
c = 0
if s[0] == s[1] or s[0] == s[2] or s[0] == 3:
  c += 1
if c != 1:
  print("No")
else:
  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:
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(S)
if len(set(S)) ==2 and S[0] == S[1] and S[1] != S[2] 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]:
      print("Yes")
else:
      print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
for i in range(4):
    count = 0
    for j in range(i, 4):
        if s[i] == s[j]:
            count += 1
        if count == 2:
            print("Yes")
            exit()
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:
s = input()
cnt = {}
str = ''
for i in s:
    str = i
    if i in cnt:
        cnt[i] += 1
    else:
        cnt[i] = 1
print(cnt)
print('Yes' if len(set(s)) == 2 and cnt[str] == 2 else 'No')

Submission status: Wrong Answer

Solution code:
s = list(input().strip())
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()

for i in range(4):
  if s.count(s[i]) == 2:
    print('Yes')
    exit()
    
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 = list(input())
S_set = set(S)

for target in S_set:
    if S.count(target) == 2:
        print("Yes")
        exit()

print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())

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

Submission status: Wrong Answer

Solution code:
s = list(input())

if s[0] == s[1] and s[2] == s[3] and s[1] is not s[2]:
  print("YES")
elif s[0] == s[3] and s[1] == s[2] and s[0] is not s[1]:
  print("YES")
elif s[0] == s[2] and s[1] == s[3] and s[0] is not s[1]:
  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[3] and s[1] == s[2]:
  print("YES")
elif s[0] == s[2] and s[1] == s[3]:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
s = list(input())

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

Submission status: Wrong Answer

Solution code:
S = input()
count = 0
s1 = 0
s2 = 0
A = dict()
N = len(S)
judge = True
for i in range(N):
    if S[i] in A:
        A[S[i]] += 1
        if A[S[i]] > 2 or count > 2:
            judge = False

    else:
        A[S[i]] = 1
        count += 1
if judge:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
sorted = sorted(list(S))

if sorted[0] == sorted[1] and sorted[2]==sorted[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]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
if len(list(set(s))) and len(list(filter(lambda x:x==s[0],s))) ==2:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())
i = 0

while i < len(s):
	if s[i] != 0:
		j = 0
		while j < len(s):
			if j != 0:
				if s[i] == s[j]:
					s[i] = 0
					s[j] = 0
			j += 1
	i += 1


for char in s:
	if char != 0:
		print("No")
		exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
S = input()
S_list = list(S)
for s in S_list:
    if S_list.count(s) == 2:
        print('Yes')
        break
    else:
        print('No')
        break

Submission status: Wrong Answer

Solution code:
s = input()
ans = []
for i in range(4):
    ans.append(s[i])

ans.sort()
print('Yes' if ans[0] == ans[1] and ans[2] == ans[3] else 'No')

Submission status: Wrong Answer

Solution code:
#132a
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:
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 collections
S = input()
c = collections.Counter(S)
x = c.most_common()
print(x)
if x[0][1] == 2:
    if x[1][1] == 2:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import collections
S = input()
c = collections.Counter(S)
x = c.most_common()
if x[0][1] == 2:
    if x[1][1] == 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 = list(input())
s.sort()
if s.count(s[0]) == s.count(s[-1]):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
# A - Fifty-Fifty
A = str(input())
Acount =[]
ans = 'No'

for i in range(len(A)):
    if A.count(A[i]) == 2:
        ans = 'Yes'
    else:
        ans = 'No'

print(ans)

Submission status: Wrong Answer

Solution code:
i = input()
j = [_ for _ in i]
j = set(j)
print(j)
if len(j) == 2:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
i = input()
j = [_ for _ in i]
set(j)
if len(j) == 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:
import sys
s = input()

s = [val for val in s]
s.sort()

a = set(s)
if len(a) != 2:
    print("NO")
    sys.exit()
if 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 = input()
list(S).sort()


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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#132 a
s=list(input())
s.sort()
print(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:
#132 a
s=list(input())
s.sort()
#print(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[0] == s[1] and s[2] == s[3] and s[1] != s[2] else "NO")

Submission status: Wrong Answer

Solution code:
s = input()
s = [ t for t in s ]
so = set(s)
 
if len(so) == 2 and  [ s.count(c) for c in so ] == [2,2] :
  print("yes")
else:
  print("No")

print(s)

Submission status: Wrong Answer

Solution code:
s = input()
s = [ t for t in s ]
so = set(s)

if len(so) == 2 and  [ s.count(c) for c in so ] == [2,2] :
  print("yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import exit, stdin
from collections import Counter
S = Counter(stdin.readline().rstrip())
if len(S.keys()) == 2 and set(S.values()) == {2}:
    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()

t = sorted(s)

#print(t)

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

Submission status: Wrong Answer

Solution code:
S = input()
for i in range(1):
  if S[i] ==S[i+1]:
    print("Yes")
  elif S[i+1]==S[i+2]:
    print("Yes")
  elif S[i+2]==S[i+3]:
    print("Yes")
  else :
    print("No")

Submission status: Wrong Answer

Solution code:
s= input()
if s.count(s[0]) == 2:
  print("Yes")
else :
  print("No")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
s = input()
dic = {}
for i in range(len(s)):
    c = s[i]
    count = dic.setdefault(c, 0) + 1
    dic[c] = count

result = "Yes"
for k in dic:
    if dic[k] != 2:
        result = "No"

print("Yes")

Submission status: Wrong Answer

Solution code:
S=sorted(input())
if S[0==S[1] and S[2]==S[3] and S[0]!=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] and S[1]!=S[2]:
  print('yes')
else:
  print('no')

Submission status: Wrong Answer

Solution code:
s = input()
s_list = [0] * 4
s_list = sorted([c for c in s])

if s_list[0] == s_list[1] and  s_list[2] != s_list[2] and  s_list[2] == s_list[3]:
  print('Yes')
  exit()
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input()
b = len(a)
d = 0

for x in range(b):
    c = a.count(a[x])
    if c > 1:
         d += 1

if d == 2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a = input()
b = len(a)
d = 0

for x in range(b):
    c = a.count(a[x])
    if c > 1:
         d += 1

if d > 2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
c = 0
for i in S:
  if S.count(i) == 2:
    c = c + 1
if (c == 4):
  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()
res = 0

for i in range(1, 4):
    if s[i] == s[0]:
        res += 1

if res == 1:
    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[2] == S[1] :
	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 = 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()
print("Yes" if s[0]==s[1] and s[2]==s[3] else "No")

Submission status: Wrong Answer

Solution code:
s = input()
print("Yes" if s.count(s[0]) ==2 else "No")

Submission status: Wrong Answer

Solution code:
lis = list(i for i in input())
if lis.count(lis[0])==lis.count(lis[1])==lis.count(lis[2])==lis.count(lis[3]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

s = input()

def solve(s):
	dct = defaultdict(int)
	for char in s:
		dct[char] += 1
		if dct[char] >= 2:
			return True
	return False

print("Yes" if solve(s) else "No")

Submission status: Wrong Answer

Solution code:
b_list = list(str(input()))
b_list = sorted(b_list)

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

Submission status: Wrong Answer

Solution code:
b_list = list(input())
b_list = sorted(b_list)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

b_list = list(input())
b_list = sorted(b_list)
if b_list[0] == b_list[1] and  b_list[2] == b_list[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[1] == s[2] and s[0] == s[3] or s[0] == s[2] and s[1] == s[3]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
s = input()
d = defaultdict()
for i in range(len(s)):
    if s[i] in d.keys():
        d[s[i]] += 1
    else:
        d[s[i]] = 1

if len(d.values()) == 2:
    for i in range(len(d.values())):
        if i == 2:
            print('Yes')
            break
        else:
            print('No')
            break

Submission status: Wrong Answer

Solution code:
s = input()
ss = set(s)
if len(ss) == 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 = 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=str(input())
if (s[0]==s[1] and s[2]==s[3]) or (s[0]==s[2] and s[3]==s[1]) or (s[0]==s[3] and s[2]==s[1]):
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
S = input()
L = sorted(list(S))

if L[0] == L[1] and L[2] == L[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]:
  print('Yes')
  
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S=input()
print("Bad" if S[0]==S[1] or S[1]==[2] or S[2]==S[3] else "Good")

Submission status: Wrong Answer

Solution code:
S = input()
S_list = list(S[i] for i in range(len(S)))

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

else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
import sys
sset = set(s)
for c in s:
  ss = list(sset)
  if c == ss[0]  or c == ss[1]:
    continue
  else:
    print('No')
    sys.exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
S = str(input())
count=0
for i in range(len(S)-1):
  for j in range(i,len(S)):
    if S[i] == S[j]:
      count+=1
if count==2:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = input()
cnt = 0
for i in range(4 - 1) :
  if s[i] != s[i + 1] :
    cnt += 1
if cnt != 0 & cnt <= 2 :
  print("Yes")
else :
  print("No")

Submission status: Wrong Answer

Solution code:
import collections

S = str(input())
c = collections.Counter(S)

if all([x==2 for x in c.values()]):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())
S.sort()
print(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 = sorted(list(input()))
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
s = input()
lis = list(s)
if s.count(lis[0]) == 2:
    print("YES")
else:
    if s.count(lis[1]) == 2:
        print("YES")
    else:
        if s.count(lis[2]) == 2:
            print("YES")
        else:
            print("NO")

Submission status: Wrong Answer

Solution code:
import collections
s = input()
c = collections.Counter(s)
if list(c.values())[0] == 2:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = input()
ans = "YES" if len(set(S)) == 2 else "NO"
print(ans)

Submission status: Wrong Answer

Solution code:
a=set(map(str,input().split()))
print("Yes" if len(a)==2 else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

s = input()

# パターン AABB ABAB ABBA
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[2]==s[1] :
    if s[0]==s[3]:
        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[2]==s[1] :
    if s[0]==s[3]:
        print('Yes')
    else :
        print('No')
elif s[0]==s[2] :
    if s[1]==s[3]:
        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[2]==s[1] :
    if s[0]==s[3]:
        print('Yes')
    else :
        print('No')
elif s[2]==s[3] :
    if s[0]==s[1]:
        print('Yes')
    else :
        print('No')
elif s[0]==s[3] :
    if s[2]==s[1]:
        print('Yes')
    else :
        print('No')
else :
    print('No')

Submission status: Wrong Answer

Solution code:
#AtCoder Beginner Contest 132 A問題
S=input()
A=[S[0]]
for i in range(3):
    if S[0]!=S[i]:
        A+=S[i]
A=list(set(A))

if len(A)==2:
    cou=S.count(S[0])
    if cou==2:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#AtCoder Beginner Contest 132 A問題
S=input()
A=[S[0]]
for i in range(2):
    if S[i+1]!=S[i]:
        A+=S[i+1]

if len(A)==2:
    cou=S.count(S[0])
    if cou==2:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#AtCoder Beginner Contest 132 A問題
S=input()
A=[S[0]]
for i in range(2):
    if S[i+1]!=S[i]:
        A+=S[i+1]

if len(A)!=2:
    print("No")
else:
    cou=S.count(S[0])
    if cou==2:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
S = sys.stdin.readline()
S1 = S.replace(S[0],'')
if len(S1) != 2:
  print('No')
  exit()
  
S2 = S1.replace(S1[0],'')
if len(S2) == 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import sys
S = sys.stdin.readline()
S1 = S.replace(S[0],'')
if len(S1) == 0:
  print('No')
  exit()
  
S2 = S1.replace(S1[0],'')
if len(S1)== 2 and len(S2) == 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import sys
S = sys.stdin.readline()
S1 = S.replace(S[0],'')
if len(S1) == 0:
  print('No')
  exit()
  
S2 = S.replace(S[0],'')
if len(S1)== 2 and len(S2) == 2:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import sys
S = sys.stdin.readline()
S1 = S.replace(S[0],'')
if len(S1) == 0:
  print('No')
  exit()
  
S2 = S.replace(S[0],'')
if len(S1)== 2 and len(S2) == 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import sys
S = sys.stdin.readline()
set_S = set(S)
if len(set_S) == 2 and len(S.replace(next(iter(set_S)), "")) == 2:
  print("Yes")
else:
  print("No")

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()
if not s[0]==s[1]==s[2]==s[3]:
    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 not s[0]==s[1]==s[2]==s[3]:
    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[3]):
        print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()

S=sorted(S)
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()
ans = 'No'
if s[0] == s[1] and s[2] == s[3]:
  ans = 'Yes'

print(ans)

Submission status: Wrong Answer

Solution code:
import collections
a = input()

print('Yes' if len(collections.Counter(a)) == 2 else 'NO')

Submission status: Wrong Answer

Solution code:
S = str(input())
ans = 'No'
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]:
    ans = 'Yes'
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
a = stdin.readline().rstrip()
b = sorted(a)
if b[0] == b[1] and b[2] == b[3]:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
if set(input()) == 2:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print(0)