Problem:


Score : 100 points

Problem Statement

In AtCoder City, there are three stations numbered 1, 2, and 3.

Each of these stations is operated by one of the two railway companies, A and B. A string S of length 3 represents which company operates each station. If S_i is A, Company A operates Station i; if S_i is B, Company B operates Station i.

To improve the transportation condition, for each pair of a station operated by Company A and one operated by Company B, there will be a bus service connecting them.

Determine if there is a pair of stations that will be connected by a bus service.

Constraints

Each character of S is A or B.

|S| = 3

Input

Input is given from Standard Input in the following format:

S

Output

If there is a pair of stations that will be connected by a bus service, print Yes; otherwise, print No.

Sample Input 1

ABA

Sample Output 1

Yes

Company A operates Station 1 and 3, while Company B operates Station 2.

There will be a bus service between Station 1 and 2, and between Station 2 and 3, so print Yes.

Sample Input 2

BBA

Sample Output 2

Yes

Company B operates Station 1 and 2, while Company A operates Station 3.

There will be a bus service between Station 1 and 3, and between Station 2 and 3, so print Yes.

Sample Input 3

BBB

Sample Output 3

No

Company B operates all the stations. Thus, there will be no bus service, so print No.



Sample input:
ABA


Sample output:
Yes

Submission status: Accepted

Solution code:
def main():
    S = input()
    if 'AB' in S:  
        print("Yes")
    elif 'BA' in S:
        print("Yes")
    else:
        print("No")
        

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
flaga = 0
flagb = 0
for i in s:
  if i == "A":
    flaga = 1
  elif i == "B":
    flagb = 1
flag = flaga + flagb
if flag == 2:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()
if(S == "AAA" or S == "BBB"):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
n = list(input())

n = list(set(n))
if len(n)>1:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
S = input()

if S == "AAA" or S == "BBB":
    ans = 'No'
else:
    ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
a = input()
if a.count('A') == 2 or a.count('B') ==2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S=input()
if S=='AAA' or S=='BBB':
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

if len(s) == 1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
ans="Yes"
if s[0]==s[1]:
    if s[1]==s[2]:
        ans="No"

print(ans)

Submission status: Accepted

Solution code:

s = input()

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

Submission status: Accepted

Solution code:
S=input()

if S=='AAA'or S=='BBB':
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S = input()


dic_ = {"A":0, "B":0}
for s in S:
  dic_[s] += 1

if dic_["A"] == 0 or dic_["B"] == 0:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
def resolve():
    S = input()
    if S == "AAA" or S == "BBB":
        print("No")
    else:
        print("Yes")


if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
S = list(i for i in input())

if 'A' in S and 'B' in S:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
d = list(input())
d = set(d)

if len(d) == 1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
import math
from collections import deque
def main():
    s = set(input())

    print("Yes" if len(s) == 2 else "No")



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def resolve():
    a = input()
    if a =="AAA" or a == "BBB":
        print("No")
    else:
        print("Yes")
resolve()

Submission status: Accepted

Solution code:
#A - Station and Bus
S = input()
if S == "AAA" or S == "BBB":
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S=input()

if S=="AAA" or S=="BBB":
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
s = input()

if (s == "AAA") or (s == "BBB"):
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
from sys import stdin
S = (stdin.readline().rstrip())
if len(set(list(S))) == 1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
s = list(input())

p = list(set(s))
if len(p) == 1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
def main():
    s = input()
    if s == 'AAA' or s == 'BBB':
        print('No')
    else:
        print('Yes')


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

s = sys.stdin.readline().rstrip()

def main():
    return 'Yes' if len(set(s)) == 2 else 'No'

if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

Solution code:
A = set(list(input()))

if len(A) == 1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S = list(input())
a = 0
b = 0
for s in S:
    if s == 'A':
        a += 1
    else:
        b += 1

if a == 0 or b == 0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    s = input()
    answer = ""
    if "A" in s and "B" in s:
        answer = "Yes"
    else:
        answer = "No"
    print(answer)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
f = lambda x,y : x.count("A") == y
print("No" if f(s, 0) or f(s, 3) else "Yes")

Submission status: Accepted

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

Submission status: Accepted

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

if len(s)==1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
S = input()

ps = ''
for s in S:
    if s != ps and ps != '':
        print('Yes')
        break
    ps = s
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())
if S == 'AAA' or S == 'BBB':
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
s_list = list(input())
a = 0
b = 0
for s in s_list:
    if s == 'A':
        a += 1
    elif s == 'B':
        b += 1
if a == 0 or b == 0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
s=input()
if s=='AAA' or s=='BBB':
    print("No")
else:
    print('Yes')

Submission status: Accepted

Solution code:
N = input()

ans = 'No' if 'AAA'==N or 'BBB'==N else 'Yes'
print(ans)

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    S = input()
    if "A" not in S or "B" not in S:
        print("No")
    else:
        print("Yes")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = str(input())

S = list(S)
ans = "Yes"

if S[0] == S[1] == S[2]:
    ans = "No"
print(ans)

Submission status: Accepted

Solution code:
cmin = lambda a,b : a if a<b else b
cmax = lambda a,b : a if a>b else b
iin = lambda : int(input())
lin = lambda : list(map(int,input().split()))
rin = lambda n : [int(input()) for _ in range(n)]

s = set(input())

print("No" if len(s)==1 else "Yes")

Submission status: Accepted

Solution code:
s = input()
if s in ('AAA', 'BBB'):
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
a = input()
if len(set(a)) > 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
S = input()
if S == 'AAA' or S== 'BBB':
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
if all(s[i] == s[0] for i in range(3)):
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
def main():


	l = list(str(input()))

	ans = 0
	for i in range(len(l)-1):
		if l[i] != l[i+1]:
			ans += 1
	if ans > 0:
		print("Yes")
	else:
		print("No")
	

if __name__ == '__main__':
	main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = [i for i in input().split()][0]
if len(set(S)) == 1:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
def main():
    s = input().rstrip()
    if s[0] != s[1] or s[1] != s[2] or s[2] != s[0]:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

s = input()

if len(set(list(s))) == 1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
s = input()
if s.find('AB') != -1 or s.find('BA') != -1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline()[:-1]


S = input()

if 'A' in S and 'B' in S:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
a_count = s.count('A')
b_count = s.count('B')
if a_count == 3 or b_count == 3:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = set(input())

if len(s) == 1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S = input()

ans = 'No'
for i in range(1, len(S)):
    if S[i-1] != S[i]:
        ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
def main():
    s = input()
    if s.__contains__("A") and s.__contains__("B"):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = list(input())
print("Yes") if "B" in S and "A" in S else print("No")

Submission status: Accepted

Solution code:
#def main(S, b):

if __name__ == '__main__':
    S = input()

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

Submission status: Accepted

Solution code:
a = input()

if a.count("A") == 0 or a.count("A") == 3:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
s=input()
print('No' if len(set(s)) == 1 else 'Yes')

Submission status: Accepted

Solution code:
bus=input()

if (bus =="AAA") or (bus=="BBB"):
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
S = input()

if S == "AAA":
    ans = "No"
elif S == "BBB":
    ans = "No"
else:
    ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
s=input()

s = list(s)

if 'A' in s and 'B' in s:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = str(input())

if s == "AAA" or s == "BBB":
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S = input()
if S.count('A') != 3 and S.count('B') != 3:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()

if "A" in N and "B" in N:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str):
    if len(set(S)) > 1:
        print("Yes")
    else:
        print("No")
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = str(input())

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

Submission status: Accepted

Solution code:
#N = int(input())
S = input()
# X1_list = [int(input()) for i in range(N)]
# X2_list = [list(map(int,input().split())) for i in range(N)]
if S == 'AAA' or S == 'BBB':
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    s = input()

    if s == 'AAA' or s == 'BBB':
        print('No')
    else:
        print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!python3

iim = lambda: map(int, input().rstrip().split())

def resolve():
    s1, s2, s3 = input()

    print("Yes" if s1 != s2 or s2 != s3 else "No")

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
S = input()
flag = True
for i in range(len(S)-1):
    if S[i]!=S[i+1]:
        flag = False
        break
print("No") if flag else print("Yes")

Submission status: Accepted

Solution code:
#!python3.4
# -*- coding: utf-8 -*-
# abc158/abc158_a
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    S = set(i2s())
    if len(S) == 1:
        print('No')
    else:
        print('Yes')
    return

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

if s == "AAA" or s == "BBB":
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
def main():
    S = input()
    if S[0] == S[1] == S[2]:
        print("No")
    else:
        print("Yes")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
set = set(input())

if len(set) == 1:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
s = input()
if s == "AAA":
  print("No")
  exit()
elif s == "BBB":
  print("No")
  exit()
else:
  print("Yes")

Submission status: Accepted

Solution code:
s = input()

if s == "AAA":
  print("No")
elif s == "BBB":
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
s = input()
if "A" in s and "B" in s:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
def read():
    S = str(input().strip())
    return S,

def solve(S):
    if S == "AAA" or S == "BBB":
        return "No"
    return "Yes"

if __name__ == '__main__':
    inputs = read()
    print("{}".format(solve(*inputs)))

Submission status: Accepted

Solution code:
a=str(input())

if a == "AAA" or a == "BBB":
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def main():
    s=list(input())
    a,b=0,0
    for i in range(3):
        if s[i]=='A':
            a+=1
        else:
            b+=1
    if a*b==0:
        print('No')
    else:
        print('Yes')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
if s == "AAA" or s == "BBB":
	print ("No")
else:
	print ("Yes")

Submission status: Accepted

Solution code:
s = input()
if (not ("A" in s)) or (not ("B" in s)):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def main():
    s = input()
    if s.count(s[0]) != 3:
        print("Yes")
    else:
        print("No")


main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
s = input()
if s == "AAA" or s=="BBB":
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s=list(input())
print('Yes' if len(set(s))>1 else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S = set(input())
if {"A", "B"} == S:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip() 

def resolve():
    S = input()
    if S[0] == S[1] == S[2]:
        print('No')
    else:
        print('Yes')

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
S = input()

tmp = S[0]
for i in range(3):
    if tmp !=S[i]:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
S=input()

if ("A" in S) and ("B" in S):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S=input()
x=dict()
a=0
b=0
for i in range(3):
    if S[i]=="A":
        a=1
    else:
        b=1
if a==1 and b==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
if S =="AAA" or S =="BBB":
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import copy
import queue
input = sys.stdin.readline
def LI(): return [int(x) for x in input().split()]
INF = 10**15
DD = ((1,0),(0,1),(-1,0),(0,-1))
S = input()
if 'A' in S and 'B' in S:
    print ('Yes')
else:
    print ('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

if "A" in S and "B" in S:
    print("Yes")
    exit(0)
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
if(s.count('B') == 0 or s.count('A') == 0):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
if len(set(input()))==1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
s = input()
if s =="AAA" or s == "BBB":
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
s = len(list(set(list(input()))))

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

Submission status: Accepted

Solution code:
S = list(input())

flag = False

if S[0] != S[1]:
    flag = True
if S[1] != S[2]:
    flag = True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  s = input()
  if s == 'AAA' or s == 'BBB':
    print('No')
  else:
    print('Yes')
  
if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    s = input()

    if s == 'AAA' or s == 'BBB':
        print("No")
    else:
        print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = input()

if len(set(A)) >= 2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = list(input())
a = 0
b = 0
for i in range(3):
    if s[i] == "A":
        a += 1
    else:
        b += 1
if a == 3 or b == 3:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S = list(input())

T = list(set(S))

if len(T) == 1:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
N=(input())
if N=="AAA" or N == "BBB":
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import math
from functools import lru_cache

#############
# Constants #
#############

MOD = 10**9 +7
INF = float('inf')

#############
# Functions #
#############

kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#############
# Main Code #
#############

S = str(input())


if S == "AAA" or S == "BBB":
  print("No")

else:
  print("Yes")

Submission status: Accepted

Solution code:
s=list(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

if S == 'AAA' or S == 'BBB':
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
s=list(input())
s=set(s)
if len(s)==1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()
flg = True
if s == "AAA" or s == "BBB": flg = False
print('Yes' if flg else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=input()
if "A" in x and "B" in x:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 累乗 #####
# pow(x, y, z) -> x**y % z

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	S = input()
	S = S[:-1]

	if S == "AAA" or S == "BBB":
		print("No")
	else:
		print("Yes")

	#print(ans)

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# special thanks :
#  https://nagiss.hateblo.jp/entry/2019/07/01/185421
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nCr mod m
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

# mを法とするaの乗法的逆元
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

# nHr mod m
# 問題によって、combination()を切り替えること
def H(n, r, mod=10**9+7):
	# comb = Combination(n+r-1, mod)
	# return comb(n+r-1, r)
    return combination(n+r-1, r, mod)

class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
s = str(input())
if s == 'AAA' or s == 'BBB':
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s= list(input())

if len(set(s))==1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
s = list(input())
flaga = 0
flagb = 0
for i in range(len(s)):
    if s[i] == "A":
        flaga = 1
    if s[i] == "B":
        flagb = 1

if flaga == 1 and flagb == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()

if s == 'A' *3 or s == 'B' * 3:
  print('No')
  
else:
  print('Yes')

Submission status: Accepted

Solution code:
s = input()

if s.count('A') > 0 and s.count('B') > 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = set(input())
if len(S) == 1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
s = input()
if all(i == "A" for i in s):
    print("No")
elif all(i == "B" for i in s):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
s = input()

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

Submission status: Accepted

Solution code:
S=input()
if S=='AAA'or S=='BBB':
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
# list(input())
# list(map(int, input().split()))
# int(input())
if len(set(list(input()) )) == 2:
    print('Yes')
else:
    print('No')