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:
l = list(map(str, input())) 
if l.count(l[0]) == l.count(l[1]) == l.count(l[2]) == l.count(l[3]) == 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()
s_sorted = ''.join(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()

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]:
   if not s[0] == s[1] == 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] 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()
list_s=list(s)
list_s.sort()
if list_s[0]!=list_s[1] and list_s[0]==list_s[1] and list_s[2]==list_s[3]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
set_s=set(list(s))
list_s=list(s)
list_s.sort()
if len(set_s)==2 and list_s[0]==list_s[1] and list_s[2]==list_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[1] != s[2] and s[2] == s[3]:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
def main():
	n = list(str(input()))

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

 
if __name__ == '__main__':
	main()

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=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:
a=input()
if a[0]!=a[1]:
    if a.count(a[0])==2 and a.count(a[1])==2:
        print("yes")
    else:
        print("No")
elif a.count(a[0])==2 and a.count(a[3])==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:
from collections import defaultdict

S = open(0).read()
d = defaultdict(int, {})
for s in S:
    d[s] += 1

print("Yes" if all(v is 2 for v in d.values()) else "No")

Submission status: Wrong Answer

Solution code:
s = set(open(0).read())
print("Yes" if len(s) == 2 else "No")

Submission status: Wrong Answer

Solution code:
S=open(0).read()
c={}
for s in set(S):
    c[s] = 0

for s in S:
    c[s] += 1

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

Submission status: Wrong Answer

Solution code:
S=open(0).read()
c={}
for s in set(S):
    c[s] = 0

for s in S:
    c[s] += 1

print(list(c.values()) == [2,2])

Submission status: Wrong Answer

Solution code:
import sys

li=list(input())
a=[0,0,0,0]
for i in range(4):
    a[i]=li.count(li[i]);
    if a[i]==2:
        continue
    else:
        print("No")
        sys.exit
print("Yes")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
s = input()

if s[0]==s[1] or s[2]==s[3] and s[0]==s[2] or s[1]==s[3] and s[0]==s[3] or 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] and s[0]==s[2] and s[1]==s[3] and 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] 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()
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:
S=input()
sort_list= sorted(S)
# sort_count = sort_list.count(sort_list[0])

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

Submission status: Wrong Answer

Solution code:
S = str(input())

if S[0:2] == S[2:4] or S[0:2] == ''.join(list(reversed(S[2:4]))) and S[0] != S[2]:
    print('Yes')
elif 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 = str(input())

if S[0:2] == S[2:4] or S[0:2] == ''.join(list(reversed(S[2:4]))):
    print('Yes')
elif 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 = str(input())

if S[0:2] == S[2:4] or S[0:2] == ''.join(list(reversed(S[2:4]))):
    print('Yes')
elif S[0] == S[1] and S[2] == S[3]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = str(input())

if S[0:2] == S[2:4] or S[0:2] == ''.join(list(reversed(S[2:4]))):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = sorted(input())
count = 0
if S[0] == S[1] and S[2] == S[3]:
	print("Yes")
	count = 1
if count == 0:
	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 = list(sorted(str(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 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:
n=list(input())
n.sort()
if n[0]==n[1] and n[2]==n[3]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if s[0]==s[1] and s[2]==s[3]:
    ans = "Yes"
else:
    ans = "No"

print(ans)

Submission status: Wrong Answer

Solution code:
S = str(input())
S_List = list(S)

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

Submission status: Wrong Answer

Solution code:
S = str(input())
S_List = list(S)

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

Submission status: Wrong Answer

Solution code:
S = str(input("Sを入力"))
S_List = list(S)

if S_List[0] == S_List[1] and S_List[2] == S_List[3] or S_List[0] == S_List[2] and S_List[1] == S_List[3] or S_List[0] == S_List[3] and S_List[2] == S_List[1]:
    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:
a = input()
if len(set(a))==2 and list(a).count(list(set(a))[0])==2:
    print("YES")

Submission status: Wrong Answer

Solution code:
S = input()
wk1 = (S[0]==S[1]) and (S[2]==S[3])
wk2 = (S[0]==S[3]) and (S[1]==S[2])
wk3 = (S[0]==S[2]) and (S[1]==S[3])
if wk1 or wk2 or wk3:
    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[3]) and (S[1]==S[2]) or
    (S[0]==S[2]) and (S[1]==S[3])
   ):
    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')
elif s[0] == s[1] and s[0] == s[2]:
    print('No')
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:
A=list(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:
import sys
string = input()

ch_1 = ""
ch_2 = ""
ct_1 = 0
ct_2 = 0
for ch in string:
  
  if ch_1 != ch and ch_2 != ch and ch_1 is not "" and ch_2 is not "":
    print("No")
    sys.exit(0)
  if ch_1 != ch:
    if ch_1 == "":
      ch_1 = ch
    else:
      ch_2 = ch

  if ch_1 == ch:
    ct_1 += 1
  elif ch_2 == ch:
    ct_2 += 1


if ct_1 == 2 and ct_2 == 2:
  print("Yes")

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()

ss = sorted(s)
if ss[0] == ss[1] and ss[2] == ss[3]:
    print("Yes")
    exit()

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 = list(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 = list(str(input()))

if(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()
a=[]
b=[]
for i in s:
    a.append(i)

for j in a:
    if j not in b:
        b.append(j)

c=[]
for k in b:
    c.append(a.count(k))

if c.count(2)>=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[1] == s[2] and s[0] == s[3]:
  print('Yes')
elif s[1] == s[3] and s[0] == s[2]:
  print('Yes')
elif s[1] == s[2] == s[3]:
  print('No')
elif s[0] == s[1] == s[2]:
  print('No')
elif s[0] == s[2] == s[3]:
  print('No')
elif s[0] == s[1] == s[3]:
  print('No')
elif s[0] == s[1] == s[2] == s[3]:
  print('No')
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[1] == s[2] and s[0] == s[3]:
  print('Yes')
elif s[1] == s[3] and s[0] == s[2]:
  print('Yes')
elif s[1] == s[2] == s[3]:
  print('No')
elif s[0] == s[1] == s[2]:
  print('No')
elif s[0] == s[2] == s[3]:
  print('No')
elif s[0] == s[1] == s[3]:
  print('No')
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[1] == s[2] and s[0] == s[3]:
  print('Yes')
elif s[1] == s[3] and s[0] == s[2]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

appearence = {}

for char in S:
    print(char)
    if char not in appearence:
        appearence[char] = 1
    else:
        appearence[char] += 1

if len(appearence) == 2 and all(2 == value for value in appearence.values()):
    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:
s= raw_input()
arr=[]
for i in range(4):
    if s[i] not in arr:
        arr.append(s[i])
if len(arr)!=2:
    print "NO"
else:
    a=0
    b=0
    for i in range(4):
        if s[i]== arr[0]:
            a = a+1
        elif s[i]==arr[1]:
            b=b+1
    if a == 2 and b==2:
        print "YES"
    else:
        print "NO"

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
#import math.sqrt as sqrt

#S = list(map(int, input().split()))
#B = list(map(int, input().split()))

S = list(input())
count = [0, 0, 0]

for i in range(len(S)-1):
    for j in range(i+1, len(S)):
        if S[i] == S[j]:
            count[i] += 1

       # print(S[j]+" "+S[i])

print(count)

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

Submission status: Wrong Answer

Solution code:
S = list(input())
count = [0, 0, 0]

for i in range(len(S)-1):
    for j in range(i+1, len(S)):
        if S[i] == S[j]:
            count[i] += 1

        print(S[j]+" "+S[i])

print(count)

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
import datetime

# 入力
#N = int(input())
#S = str(input())
#H, W = map(int, input().split())
S = str(input())

if (S[0] == S[1] and S[2] == S[3] and S[0] != S[2]) :
  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:
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=str(input())
l=list(s)
l.sort()
if(l[0]==l[1] and l[2]==l[3] and l[0]!=l[2]):
  print ("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
a = dict()
b = list(input())
s1 = "random"
s2 = "random"
x = 0
y = 0
for i in b:
    if i == s1:
        x += 1
    elif i == s2:
        y += 1
    else:
        if s1 == "random":
            s1 = i
            x += 1
        else:
            s2 = i
            y += 1
if x == 2 and y == 2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if s[0]==s[1]:
    c+=1
if s[0]==s[2]:
    c+=1
if s[0]==s[3]:
    c+=1
if s[1]==s[2]:
    c+=1
if s[2]==s[3]:
    c+=1

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

Submission status: Wrong Answer

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

if s[0]==s[1]:
    c+=1
if s[0]==s[2]:
    c+=1
if s[0]==s[3]:
    c+=1
if s[1]==s[2]:
    c+=1
if s[2]==s[3]:
    c+=1

if c == 2:
    print('yes')
else:
    print('no')

Submission status: Wrong Answer

Solution code:
letter = input()
word = []
for i in range(len(letter)):
  word.append(letter[i])
word.sort()
if (word[0] == word[1]) and (word[2] == word[3]):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = input()
f = 1 
if (s[0] == s[1] and s[2] == s[3] and s[1] != s[2]) or ((s[:2] == s[2:] or s[1::-1] == s[2:]) and s[1] != s[2]):
        f = 0 
print('YNeos'[f::2])

Submission status: Wrong Answer

Solution code:
s = input()
f = 1 
if (s[0] == s[1] and s[2] == s[3]) or (s[:2] == s[2:] or s[1::-1] == s[2:]):
        f = 0 
print('YNeos'[f::2])

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=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 = list(input())

if (S[0] == S[1] and S[2] == S[3] and S[0] != S[1]) or (S[0] == S[2] and S[1] == S[3] and S[0] != S[1]) or (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:
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 = str(input())

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 = str(input())

if S[0] == S[1] and S[2] == S[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 = 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()
buf = 0
for i in range(len(S)) :
    for j in range(i+1,len(S)) :
        if S[i] == S[j] :
            buf += 1

if buf == 2 :
    print('YES')
else :
    print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
sCnt = s.count('S')
if sCnt != 2 and sCnt != 4:
    print('No')
else:
    s = ''.join(sorted(s))
    if s[0]=='S':
        if s[2]==s[3]:
            print('Yes')
        else:
            print('No')
    elif  s[3]=='S':
        if s[0]==s[1]:
            print('Yes')
        else:
            print('No')
    else:
        if s[1]==s[2]:
            print('Yes')
        else:
            print('No')

Submission status: Wrong Answer

Solution code:
s = input()
sCnt = s.count('S')
if sCnt != 2:
    print('No')
else:
    s = ''.join(sorted(s))
    if s[0]=='S':
        if s[2]==s[3]:
            print('Yes')
        else:
            print('No')
    elif  s[3]=='S':
        if s[0]==s[1]:
            print('Yes')
        else:
            print('No')
    else:
        if s[1]==s[2]:
            print('Yes')
        else:
            print('No')

Submission status: Wrong Answer

Solution code:
s = 'ASSA' #input()
sCnt = s.count('S')
if sCnt != 2:
    print('No')
else:
    s = ''.join(sorted(s))
    if s[0]=='S':
        if s[2]==s[3]:
            print('Yes')
        else:
            print('No')
    elif  s[3]=='S':
        if s[0]==s[1]:
            print('Yes')
        else:
            print('No')
    else:
        if s[1]==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] and s[0] != s[3]:
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

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

if len(s) == 4:
    if s[0] == s[1] and s[2] == s[3] and s[0] != s[3]:
        print("yes")
    else:
        print("no")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
s = sorted(list(input()))
if len(s) == 4:
    if s[0] == s[1]:
        if s[2] == s[3] and s[1] != s[2]:
            print("yes")
        else:
            print("no")

    else:
        print("no")
else:
    print("no")

Submission status: Wrong Answer

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

else:
    print("no")

Submission status: Wrong Answer

Solution code:
S=str(input())
s=list(S)
a=s[0]
b=''
count1=0
count2=0
for i in range(len(s)):
    if s[i]!='a':
        b=s[i]
        break
for i in range(len(s)):
    if s[i]==a:
        count1+=1
    if s[i]==b:
        count2+=1
if count1==2 & count2==2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = list(input())
S.sort()
s1 = S[:2]
s2 = S[2:]
if s1[0] == s1[1] and s2[0] == s2[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]) or (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(input())
if len(s) == 4:
    if s[0] == s[1]:
        if s[2] == s[3] and s[0] != s[2]:
            print("yes")
        else:
            print("no")
    elif s[1] == s[2] :
        if s[0] == s[3] and s[1] != s[0]:
            print("yes")
        else:
            print("no")
    elif s[2] == s[3] :
        if s[0] == s[1] and s[2] != s[0]:
            print("yes")
        else:
            print("no")
    else:
        print("no")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
s = list(input())
if len(s) == 4:
    if s[0] == s[1]:
        if s[2] == s[3] and s[0] != s[2]:
            print("yes")
        else:
            print("no")
    elif s[1] == s[2] and s[1] != s[0]:
        if s[0] == s[3]:
            print("yes")
        else:
            print("no")
    elif s[2] == s[3] and s[2] != s[0]:
        if s[0] == s[1]:
            print("yes")
        else:
            print("no")
    else:
        print("no")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
s = input()
if len(s) == 4:
    if s[0] == s[1]:
        if s[2] == s[3] and s[0] != s[2]:
            print("yes")
        else:
            print("no")
    elif s[1] == s[2] and s[1] != s[0]:
        if s[0] == s[3]:
            print("yes")
        else:
            print("no")
    elif s[2] == s[3] and s[2] != s[0]:
        if s[0] == s[1]:
            print("yes")
        else:
            print("no")
    else:
        print("no")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
s = input()
if len(s) == 4:

    if s[0] == s[1]:
        if s[2] == s[3]:
            print("yes")
        else:
            print("no")
    elif s[1] == s[2]:
        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")
    else:
        print("no")

else:
    print("no")

Submission status: Wrong Answer

Solution code:
s = list(input())
if s[0] == s[1]:
    if s[2] == s[3]:
        print("yes")
    else:
        print("no")
elif s[1] == s[2]:
    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")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
import re

s = sorted(input())
s = "".join(s)

if re.match(r"(.)\1(.)\2", s):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=input()
k=sorted(n)
if k[0]==k[1] and k[2]==k[3]:
  print("Yes")
  
else:
  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 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=str(input())
a = S[0:1]
b = S[1:2]
c = S[2:3]
d = S[3:4]
if a==b:
    if c==d:
        print('Yes')
    else:
        print('No')
elif a==c:
    if b==d:
        print('Yes')
    else:
        print('No')    
elif a==d:
    if b==c:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
ls_s = [i for i in input()]
ls_s1 = sorted(ls_s)

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

Submission status: Wrong Answer

Solution code:
ls_s = [i for i in input()]
ls_s1 = sorted(ls_s)

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

Submission status: Wrong Answer

Solution code:
# ABC 132: A – Fifty-Fifty
s = input()
is_twice = 'Yes'

for c in s:
    if s.count(c) % 2 != 0:
        is_twice = 'No'
        break

print(is_twice)

Submission status: Wrong Answer

Solution code:
S = map(str , input())
list_S = list(S)

list_S.sort

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
flag = 0

if s[0] == s[1] and s[2] == s[3]:
    if s[1] != s[2]:
        flag = 1
elif s[0] == s[2] and s[1] == s[3]:
    if s[1] != s[2]:
        flag = 1
elif s[0] == s[3] and s[1] == s[2]:
    if s[0] != s[1]:
        flag = 1

if flag == 1:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
s = input()
flag = 0

if s[0] == s[1] and s[2] == s[3]:
    flag = 1
elif s[0] == s[2] and s[1] == s[3]:
    flag = 1
elif s[0] == s[3] and s[1] == s[2]:
    flag = 1

if flag == 1:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
s = list(input());
ans = 0;

if s[0] == s[1] or s[0] == s[2] or s[0] == s[3]: ans += 1;
if s[1] == s[2] or s[1] == s[3]: ans += 1;
if s[2] == s[3]: ans += 1;

print(ans);

Submission status: Wrong Answer

Solution code:
s = list(input());
ans = 0;

if s[0] == s[1] or s[0] == s[2] or s[0] == s[3]: ans += 1
if s[1] == s[2] or s[1] == s[3]: ans += 1
if s[2] == s[3]: ans += 1
print(ans);

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import itertools
S = list(input())
S2 = list(set(S))

if len(S2) == 2:
    print('YES')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = list(input())

if S[0] == S[1]:
    print('Bad')
elif S[1] == S[2]:
    print('Bad')
elif S[2] == S[3]:
    print('Bad')
else:
    print('Good')

Submission status: Wrong Answer

Solution code:
S = list(input())
S.sort()
print(S)
if S[0] == S[1] == S[2] == S[3]:
    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(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()

for i in range(3):
    if S[i] == S[i+1] and S[i+2] == S[i+3]:
        print('Yes')
        exit()
    else:
        print('No')
        exit()

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

Submission status: Wrong Answer

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

if 2 in c.values() or len(c.keys()) == 2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
s = input()
if (len(set(list(s))) == 2):
    if s.count(s[0]) == 2:
        print("YES")
    else:
        print("NO")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
import sys
s = input()
chars = set(list(s))
if len(chars) != 2:
    print("NO")
    sys.exit()
if s.count(s[0]) == 2:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
import sys
s = input()
chars = set(list(s))
if len(chars) != 2:
    print("NO")
    sys.exit()
for i in chars:
    if s.count(i) < 2:
        print("NO")
        sys.exit()
print("YES")

Submission status: Wrong Answer

Solution code:
import sys
s = input()
chars = set(list(s))
for i in chars:
    if s.count(i) !=2:
        print("NO")
        sys.exit()
print("YES")

Submission status: Wrong Answer

Solution code:
import sys
s = input()
chars = set(list(s))
if len(chars) != 2:
    print("NO")
    sys.exit()
for i in chars:
    if s.count(i) !=2:
        print("NO")
        sys.exit()
print("YES")

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()

for i in range(4):
    cnt = s.count(s[i])
    if cnt == 2:
        continue
    else:
        print('No')
print('Yes')

Submission status: Wrong Answer

Solution code:
s = list(input())
if s[0] == s[1] and s[1] != s[2] and s[2] == s[3]:
    print("yes")
elif s[0] == [2] and s[2] != s[1] and s[1] == s[3]:
    print("yes")
elif s[0] == s[3] and s[3] != s[1] and s[1] == s[2]:
    print("yes")
else:
    print("no")