peterverebics/CodeNet_Python_118 huggingface dataset:
import re
s = input()
l = re.split('(..)', s)[1::2]
judge = [c=="hi" for c in l]
if all(judge):
  print("Yes")
else:
  print("No")
S = input()

for i in range(len(S) - 1):
    if S[i] == "h" and S[i + 1] == "i":
        print("Yes")
        exit()

print("No")
s = input()
h_else_i = True

ret = True
for char in s:
  if h_else_i:
    if char == "h":
      h_else_i = not h_else_i
      continue
    else:
      ret = False
      break
  else:
    if char == "i":
      h_else_i = not h_else_i
      continue
    else:
      ret = False
      break
if ret:
  print("Yes")
else:
  print("No")
S = input()
if S.count('hi') is 0:
    print('No')
print('Yes')
if __name__ == '__main__':
    S=input()
    i=0
    j=len(S)
    if j%2==0:
        for l in range(0,len(S),2):
            i=0
            if(S[l]=='h' and S[l+1]=='i'):
                i=1
    if i==1:
        print('Yes')
    else:
        print('NO')
s = input()
if s.count('hi') > 0: print('Yes')
else: print('No')
*s, = input()

ans = "Yes"
for i in range(0, len(s)-1, 2):
    if s[i] != "h" or s[i+1] != "i":
        ans = "No"
        break

print(ans)
S = input()
N = int(len(S)/2)

[print('Yes') if S == 'hi'*N else print('NO')]
s=input()
a=0
for i in range(len(s)):
  if i%2==0:
    if s[i]!="h":
      a=1
  else:
    if s[i]!="i":
      a=1
if a==0:
  print("Yes")
else:
  print("No")
s=list(input())
for i in range(len(s)-1):
 if s[i]+s[i+1]=='hi':
  print('Yes')
  exit()
print('No')
s = input()
if len(list(set(s))) == 2:
  print('Yes')
else:
  print('No')
S=input()
s=set(S)
if len(s)==2:
  print("Yes")
else:
  print("No")
def main():
    S = input()

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


if __name__ == "__main__":
    main()
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
s = set(input())

if len(s)==1:
  print('No')
else:
  print('Yes')
#A
s=input()
if s[0]==s[1]==s[2]:
    print('No')
else:
    print('Yes')
S=input()
print('No' if S=='AAA' or S=='BBB' else 'Yes')
s = input()
if s == "AAA" or s == "BBB":
    print("No")
else:
    print("Yes")
arr = input()
cnt = 0
for a in arr:
    if a == 'A':
        cnt += 1

if cnt == 0 or cnt == len(arr):
    print("No")
else:
    print("Yes")
S = input()

s1 = S[0]
s2 = S[1]
s3 = S[2]

if s1 == s2 and s2 == s3 and s3 == s1:
    print('No')
else:
    print('Yes')
str = input()
count_A = str.count('A')
count_B = str.count('B')
if count_A > 0 and count_B > 0:
  print('Yes')
else :
  print("No")
S = str(input())
if S == "AAA":
  ans = 'No'
elif S == "BBB":
  ans = 'No'
else:
  ans = 'Yes'
print(ans)
s = input()
if "A" in s and "B" in s:
    print("Yes")
else:
    print("No")
s = list(input())

s.sort()

if s[0]==s[2]:
  print('No')
else:
  print('Yes')
S=list(input())

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

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

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

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

if("A" in S and "B" in S):
  print("Yes")
else:
  print("No")
def main():
    S=input()
    if S=="AAA" or S=="BBB":
        print("No")
    else:
        print("Yes")
if __name__ == '__main__':
    main()
S = input()
if 'A' in S and 'B' in S:
  print('Yes')
else:
  print('No')
s = str(input())
if s == 'AAA':
    print('No')
if s == 'BBB':
    print('No')
if s != 'AAA' and s != 'BBB':
    print('Yes')
s = input()

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

if (len(set(S)) == 1):
    ans = 'No'
else:
    ans = 'Yes'

print(ans)
S = input()
print('No' if S in ['AAA', 'BBB'] else 'Yes')
s = input()
if len(set(s)) == 1:
    print('No')
else:
    print('Yes')
S = input()
if S.find("A") == -1 or S.find("B") == -1:
    print("No")
else:
    print("Yes")
S = input()

if len(S)==3 and S.count('A')==2 or S.count('B')==2:
    print('Yes')

else:
    print('No')
import sys

S = list(sys.stdin.readline().strip())
if len(set(S)) > 1:
    print("Yes")
else:
    print("No")
print(["No","Yes","Yes","No"][sum([s=="A" for s in input()])])
#!/usr/bin/env python3

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

flg="No"
for i in range(2):
    if station[i]!=station[i+1]:
        flg="Yes"

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

if S=='AAA' or S=='BBB':
  print('No')
else:
  print('Yes')
s=input()
print("Yes"if s[0]!=s[1] or s[1]!=s[2] else "No")
s = str(input())
if s=="AAA" or s=="BBB":
    print("No")
else:
    print("Yes")
s=input()
print('No' if len(set(s)) == 1 else 'Yes')
S = input()
if S.count('A') == 3 or S.count('B') == 3:
    print('No')
else:
    print('Yes')
def Main(S):
    return "Yes" if 'A' in S and 'B' in S else "No"
    
def main():
    S = str(input())
    print(Main(S))

if __name__ == '__main__':
    main()
S = input().rstrip()

if 'AB' in S or 'BA' in S:
    print('Yes')
else:
    print('No')
S=input()
a=S[0]
z=0
for i in range(len(S)):
    if a==S[i]:
        a=S[i]
    else:
        z=1

if z==0:
    print('No')
else:
    print('Yes')
S = input()
print('No' if ('A' in S) == False or ('B' in S) == False else 'Yes')
s = input()
if (s[0]==s[1] and s[1]==s[2]):
    print("No")
else:
    print("Yes")
s = input()
if s[0]==s[1] and s[1]==s[2]:
    print("No")
else:
    print("Yes")
s = input()

if s == 'AAA' or s == 'BBB':
    print("No")
else:
    print("Yes")
s=input()
S1=s[0]
S2=s[1]
S3=s[2]

if S1==S2==S3=="A":
    print("No")
elif S1==S2==S3=="B":
    print("No")
else:
    print("Yes")
s = list(input())

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

if 'A' in S:
  if 'B' in S:
    print('Yes')
  else:
    print('No')
else:
  print('No')
S = input()
if 'A' in S and 'B' in S: print('Yes')
else: print('No')
s = input()
if s.count('A') == 3 or s.count('B') == 3:
    print('No') 
else:
    print('Yes')
#!/usr/bin/env python3
import sys

input = sys.stdin.readline


def Y():
    print("Yes")


def N():
    print("No")


def ST():
    return input().rstrip()


def I():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return list(MI())


S = ST()

if ("A" not in S) or ("B" not in S):
    N()
else:
    Y()
stations = input()
listStations = list(stations)
if len(set(listStations)) == 2:
    print("Yes")
else:
    print("No")
S = list(input())
if S.count('A') >= 1 and S.count('B') >= 1:
    print('Yes')
else:
    print('No')
S = input()

if S[0] == S[1] == S[2]:
  print('No')
else:
  print('Yes')
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

S = str(input())

if S[0]==S[1]==S[2]:
    print('No')
else:
    print('Yes')
S = input()
if S == "AAA" or S == "BBB":
	print("No")
else:
	print("Yes")
S = input()
if "A" in S and "B" in S:
  print("Yes")
else:
  print("No")
n = list(input())

if n[0]=="A":
    if n[1]=="B":
        print("Yes")
    else:
        if n[2]=="B":
            print("Yes")
        else:
            print("No")
else:
    if n[1]=="A":
        print("Yes")
    else:
        if n[2]=="A":
            print("Yes")
        else:
            print("No")
#文字列の入力
S = input()
 
#listを一文字ずつのlistに
S_list = list(S)
 
AorB = S_list[0]
counter = 0
for i in range(len(S_list)):
  if(AorB == S_list[i]):
    counter = counter + 1
 
if(counter == len(S_list)):
  print("No")
else:
  print("Yes")
s = input()
print("No" if s[0] == s[1] == s[2] else "Yes")
s = input()
print('Yes' if 'AB' in s or 'BA' in s else 'No')
S = input()

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

if S == "AAA" or S == "BBB":
  print("No")
else:
  print("Yes")
import numpy as np

bus = input()

if bus == "AAA":
    print("No")
elif bus == "BBB":
    print("No")
else:
    print("Yes")
S = input()
if (S=="AAA")or(S=="BBB"):
    print("No")
else:
    print("Yes")
# -*- coding: utf-8 -*-
s = set(list(input()))
if len(s) == 1:
    print('No')
else:
    print('Yes')
s = input()
if s[0] == s[1] and s[1] == s[2]:
    print("No")
else:
    print("Yes")
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()
s = input()

if s == "AAA" or s == "BBB":
  print("No")
else:
  print("Yes")
s = input()
if s in ['AAA', 'BBB']:
  print('No')
else:
  print('Yes')
a, b, c = input()

if a==b==c:
    print('No')
else:
    print('Yes')
s = input()
g = set(s)
if('A' in g and 'B' in g):
  print('Yes')
else:	print('No')
S = list(map(str, input()))
if S[0] == S[1] and S[1] ==S[2] and S[2] == S[0]:
  print("No")
else:
  print("Yes")
s = input()

if s == 'AAA' or s == 'BBB':
    print('No')
else:
    print('Yes')
S=input()
print(("No","Yes")[len(set(S))>1])
s = input()

if s == 'AAA' or s == 'BBB' :
    print('No')
else :
    print('Yes')
#!/usr/bin/env python3
s = input()
print("No" if s == "AAA" or s == "BBB" else "Yes")
char_data = list(input())

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

if len(set(s)) == 1:
  print("No")
else:
  print("Yes")
s=list(input())
if s[0] != s[1] or s[1] != s[2]:
    print("Yes")
else:
    print("No")
S = set(list(str(input())))
if len(S) == 1:
  print("No")
else:
  print("Yes")
S = list(input())

if len(set(S)) == 1:
    print ('No')
else:
    print ('Yes')
S = input()
if S[0] == S[1] == S[2]:
  print("No")
else:
  print("Yes")
S = input().strip()
if (S == 'AAA' or S == 'BBB'):
	print('No')
else:
	print('Yes')
s = input()
pre = s[0]
for a in s[1:]:
  if pre != a:
    print("Yes")
    exit()
  pre = a
print("No")
# A

S=input()

if S=="AAA" or S=="BBB":
  print("No")
else:
  print("Yes")
import sys
import numpy as np

# input = sys.stdin.readline

s = input()

if (s == "AAA") or (s == "BBB"):
    print("No")
else:
    print("Yes")
1.
S = input()

if len(S)==3 and S.count('A')==2 or S.count('B')==2:
    print('Yes')

else:
    print('No')
S = input()

if S == 'AAA':
    print('No')
elif S == 'BBB':
    print(('No'))
else:
    print('Yes')
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    s = set(list(input()))
    if len(s) == 1: 
        print('No')
    else:
        print('Yes')


if __name__ == '__main__':
    solve()
N = input()

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

S = list(S)
ans = "Yes"

if S[0] == S[1] == S[2]:
    ans = "No"
print(ans)
S=str(input())
if S=='AAA' or S=='BBB':
  print('No')
else:
  print('Yes')
if __name__ == '__main__':
    s = input()
    print("No" if s == "AAA" or s == "BBB" else "Yes")
#
import sys
import math
import numpy as np
import itertools

p=input()

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

if S == 'AAA' or  S == 'BBB':
    print('No')
else:
    print('Yes')
import sys
n=input()
j=0

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

if (s[0] == s[2]) and (s[0] != s[1]):
    print('Yes')
elif (s[1] == s[2]) and (s[0] != s[2]):
    print('Yes')
elif (s[0] == s[1]) and (s[0] != s[2]):
    print('Yes')
else:
    print('No')
S=input()
if S=="BBB" or S=="AAA":
  print("No")
else:
  print('Yes')
a=list(input())
if a[0]==a[1]==a[2]:
  print('No')
else:
  print('Yes')
# coding: utf-8
S = input()
if (S[0] == S[1]) & (S[1] == S[2]):
    print('No')
else:
    print('Yes')
S=input()
if S=='AAA' or S=='BBB':
  print('No')
else:
  print('Yes')
S = input()
if S[0] != S[1] or S[1] != S[2]:
    print('Yes')
else:
    print('No')
s = input()
print("No" if s == "AAA" or s == "BBB" else "Yes")
s=input()

if (s == 'AAA') or (s == 'BBB'):
    print('No')
else:
    print('Yes')
s = input()
s1 = s[0]
s2 = s[1]
s3 = s[2]

if s1 == s2:
  if s1 == s3:
    print('No')
    exit()
print('Yes')
a = list(input())
A_flag = False
B_flag = False

for n in range(3) :
    if a[n] == "A":
        A_flag = True
    elif a[n] == "B":
        B_flag = True
if A_flag and B_flag:
    print("Yes")
else:
    print("No")
st = input()
if st == 'A'*3 or st == 'B'*3:
    print('No')
else:
    print('Yes')
S = input()
if S == 'AAA' or S == 'BBB':
    print('No')
else:
    print('Yes')
a = str(input())
if a == 'AAA' or a == 'BBB':
    print('No')
else:
    print('Yes')
s = input()
print('Yes' if 'A' in s and 'B' in s else 'No')
S = list(input())
if S[0] == S[1] and S[1] == S[2]:
    print('No')
else:
    print('Yes')
S = list(input())
if S[0] == S[1] and S[0] == S[2]:
    print("No")
else:
    print("Yes")
S=input()
if S=="AAA" or S=="BBB":
    print("No")
else:
    print("Yes")
s=input()
if s=="AAA" or s=="BBB":
  print("No")
else:
  print("Yes")
N = input()
ans = 'Yes'
n0 = N[0]
count = 0
if N[0] == N[1]:
    count = count + 1
if N[1] == N[2]:
    count = count + 1
if N[0] == N[2]:
    count = count + 1
if count == 3:
    ans = 'No'
print(ans)
S = list(input())
s = set(S)
if len(s)!=1:
    print('Yes')
else:print('No')
S = input()
if 'A' in S and 'B' in S:
    print('Yes')
else:
    print('No')
s = list(input())
ans = 'Yes'
if s.count('A') == 3 or s.count('B') == 3:
    ans = 'No'
print(ans)
s = input()
if s == 'AAA' or s == 'BBB':
    print('No')
else:
    print('Yes')
s = input()

if s[0] != s[1]:
    print("Yes")
elif s[1] != s[2]:
    print("Yes")
else:
    print("No")
station = input()
print("Yes" if "AB" in station or "BA" in station else "No")
S = str(input())

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

if S[0] == 'A' and S[1] == 'A' and S[2] == 'A':
    print('No')
elif  S[0] == 'B' and S[1] == 'B' and S[2] == 'B':
    print('No')
else:
    print('Yes')
S=list(input())
if S[0]==S[1] and S[0]==S[2]:
    print('No')
else:
    print('Yes')
N = input()

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

else:
  print("Yes")
str_ = input()
print('Yes') if 'A' in str_ and 'B' in str_ else print('No')
import sys
input = sys.stdin.readline

S = input().rstrip()
from collections import Counter

c = Counter(S)

if len(c.keys()) == 2:
    print("Yes")
else:
    print("No")
s = list(input())

if s[0] == s[1] and s[1] == s[2]:
    print('No')
else:
    print('Yes')
s = input()
dic = {"A":False,"B":False}
for c in s:
    dic[c] = True
if dic["A"] and dic["B"]:
    print("Yes")
else:
    print("No")
a=input()
flag=False
if a[0]!=a[1]:
    flag=True
if a[1]!=a[2]:
    flag=True

if flag:
    print("Yes")
else:
    print("No")
s = input()
l = set(s)
if len(l) == 1:
    print("No")
else:
    print("Yes")
#!/usr/bin/env python3
print("Yes") if len(set(input())) > 1 else print("No")
s = list(input())
ans = set(s)
if len(ans) > 1:
  print('Yes')
else:
  print('No')
x = list(input())
if "A" in x and "B" in x:
  print("Yes")
else:
  print("No")
s = input()

if s[0] != s[1] or s[1] != s[2]:
    print("Yes")
else:
    print("No")
s = input()
if "AB" in s or "BA" in s:
    print("Yes")
else:
    print("No")
if __name__ == '__main__':
    s = input()
    if (s[0] == s[1]) and (s[1] == s[2]):
        print("No")
    else:
        print("Yes")
S = input()
NS = [0]*len(S)
for i in range(len(S)):
    NS[i] = S[i]

#print(NS)
#print(len(set(NS)))

if len(set(NS)) == 1:
    print('No')
else:
    print('Yes')
a = input()
if a[0] == a[1] == a[2]:
  print("No")
else:
  print("Yes")
S=input()
if 'AAA'==S or 'BBB'==S:
    print('No')
else:
    print('Yes')
#バスが運行するかどうか Yes　運航する
S=input()
if S[0]==S[1] and S[0]==S[2]:
    print("No")
else:
    print("Yes")
s = input()
print('No' if s in ['AAA', 'BBB'] else 'Yes')
# 158 A
S = input()
print('No') if S == 'AAA' or S == 'BBB' else print('Yes')
S = input()

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

if 'A' in S and 'B' in S:
  print('Yes')
else:
  print('No')
s=input()
if s[0]==s[1] and s[1]==s[2]:
    print("No")
else:
    print("Yes")
def main():
    S = input()
    ans = "No"
    for i in range(2):
        if (S[i] != S[i+1]):
            ans = "Yes"
    print(ans)


if __name__ == '__main__':
    main()
#!/usr/bin/env python3

S = input()
print("Yes" if "A" in S and "B" in S else "No")
s=input()
if s[0]==s[1] and s[1] == s[2]:
	print('No')
else:
	print('Yes')
S = input()

ps = ''
for s in S:
    if s != ps and ps != '':
        print('Yes')
        break
    ps = s
else:
    print('No')
s=input()
S=list(s)
t=set(S)
if len(t)==1:
  print('No')
else:
  print('Yes')
s=sorted(set(input()))
print('Yes' if ['A','B'] == s else 'No')
print('Yes' if 'AAA'<input()<'BBB' else 'No')
#ABC158-A
s=input()
if s!='AAA' and s!='BBB':
  print('Yes')
else:
  print('No')
_string = input()

if _string == "AAA" or _string == "BBB":
    print("No")
else:
    print("Yes")
s=input()
if(s.count('A')>=1 and s.count('B')>=1):
    print("Yes")
else:
    print("No")
s = list(input())
ans = "Yes" if len(set(s)) == 2 else "No"
print(ans)
S = input()
print("No" if S == "AAA" or S == "BBB" else "Yes")
s = input()

if s[0] == s[1] and s[1] == s[2]:
    print("No")
else:
    print("Yes")
S = input()
print('Yes') if 'A' in S and 'B' in S else print('No')
s = input()

if (s == 'AAA') | (s == 'BBB'):
    print('No')
else:
    print('Yes')
def main():
    args = input().rstrip().split(' ')
    S = [c for c in args[0]]
    if(S[0]==S[1] and S[0]==S[2] and S[1]==S[2]):
        print('No')
    else:
        print('Yes')
    
if __name__ == "__main__":
    main()
S = input()
if S == "AAA" or S == "BBB":
    print("No")
else:
    print("Yes")
s = input()
if s == 'A'*3 or s == 'B'*3:
    print('No')
else:
    print('Yes')
S = str(input())
 
if S[0] == S[1] == S[2]:
  print("No")
else:
  print("Yes")
s = input()

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

if (S == "AAA"):
    print("No")
elif (S == "BBB"):
    print("No")
else:
    print("Yes")
s=input()
if 'A' in s and 'B' in s:
    print("Yes")
else:print("No")
S = input()

if S[0]==S[1] and S[0]==S[2]:
    ans = 'No'
else:
    ans = 'Yes'
print(ans)
s=input()
count=s.count("B")
if count==3 or count==0:
    print("No")
else:
    print("Yes")
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()
S = input()
A = False
B = False

for s in S:
  if s == "A":
    A = True
  else:
    B = True

if A == True and B == True:
  print("Yes")
else:
  print("No")
com = input()
if com[0] == com[1] == com[2]:
  print("No")
else:
  print("Yes")
S = input()
if S == "AAA":
    print("No")
else:
    if S == "BBB":
        print ("No")
    else:
        print("Yes")
#A, B = map(int,input().split())
S = input()
if S == "AAA" or S == "BBB":
    print("No")
else:
    print("Yes")
s = input()

if s == 'AAA' or s == 'BBB':
  print('No')
else:
  print('Yes')
S = input()
if S.count('A') == 3 or S.count('B') == 3:
  print('No')
else:
  print('Yes')
# -*- coding: utf-8 -*-
# Input of 3 stations
stations = input() # i.e. ABA

def needBus(s):
  '''<str> s: 3 stations'''
  if ((s[0] != s[1]) or (s[1] != s[2])):
    return 'Yes'
  else:
    return 'No'
  
# Output
print(needBus(stations))
S = input()

if "A" in S and "B" in S:
    print("Yes")
    exit(0)
print("No")
S = list(input())
a = S.count("A")
b = S.count("B")

if a == 3 or b == 3:
    print("No")
else:
    print("Yes")
n = input()

if n == "AAA" or n == "BBB":
  print("No")
else:
  print("Yes")
S=list(input())
S=set(S)

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

if S == "AAA":
    print("No")
elif S == "BBB":
    print("No")
else:
    print("Yes")
S = input()
if S != 'AAA' and S != 'BBB':
    print('Yes')
else:
    print('No')
# A - Station and Bus

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

if ('A' in S) & ('B' in S):
    print('Yes')
else:
    print('No')
s = input()

a = False
for i in range(len(s)):
    if s[i] == "A":
        a = True
        break

b = False
for i in range(len(s)):
    if s[i] == "B":
        b = True
        break

if a and b:
    print("Yes")
else:
    print("No")
def main():
    S = input()
    if S == 'AAA' or S == 'BBB':
        print('No')
    else:
        print('Yes')

main()
# n = int(input())

# c = list(map(int, input().split()))
# s = [list(map(int, list(input()))) for i in range(10)]
s = input()

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

if s.count('A') == 3:
    print("No")
elif s.count('A') == 0:
    print("No")
else:
    print("Yes")
s=input()

if s=='AAA' or s=='BBB':
  print('No')
else:
  print('Yes')
s = {c for c in input()}

if len(s) == 1:
    print('No')
else:
    print('Yes')
S = input()
if S[0] == S[1] and S[1] == S[2]:
  print('No')
else:
  print('Yes')
# N
n = input()
if "AB" in n or "BA" in n:
  print("Yes")
else:
  print("No")
s = list(input())
a, b = 0, 0
a = s.count('A')
b = s.count('B')

if a > 0 and b > 0:
    print('Yes')
else:
    print('No')
data = input()
if data == "AAA" or data == "BBB":
  print("No")
else:
  print("Yes")
# coding: utf-8
S = set(list(input()))
print("Yes" if len(S) != 1 else "No")
S = input()

if S == "AAA" or S =="BBB":
  print("No")
else:
  print("Yes")
a = input()
print('Yes' if a.count('A') >= 1 and a.count('B') >= 1 else 'No')
import sys
sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = input()

if S == 'AAA' or S == 'BBB':
    print('No')
else:
    print('Yes')
s=input()
if s.count('A')>0 and s.count('B')>0:
  print('Yes')
else:
  print('No')
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")
#! /usr/bin/env python3

s=set(input())
print("Yes") if len(s)==2 else print("No")
s = list(input())
if (s == ['A', 'A', 'A']) or (s == ['B', 'B', 'B']):
    print('No')
else:
    print('Yes')
a = list(input())
a = set(a)

if len(a)==2:
  print('Yes')
else:
  print('No')
s=input()
a=['Yes','No']
print(a[s.count('A')==3 or s.count('B')==3])
# -*- coding: utf-8 -*-
S = input()
if S == "AAA" or S == "BBB":
    print("No")
else:
    print("Yes")
import sys
input = sys.stdin.readline

s = input()
s_unique = ''.join(set(s))

# print(len(s_unique))

if len(s_unique) == 2:
    print("No")
else:
    print("Yes")
import sys

s = list(input())
if s[0] == 'A' and s[1] == 'A' and s[2] == 'A':
  print('No')
  sys.exit()
if s[0] == 'B' and s[1] == 'B' and s[2] == 'B':
  print('No')
  sys.exit()
print('Yes')
print("Yes" if len(set(list(input()))) > 1 else "No")
import sys

S=sys.stdin.readline()
m={}
for s in S:
    m[s] = True
if "A" in m and "B" in m:
    print("Yes")
else:
    print("No")
S = input()
if S[0] == S[1] and S[1] == S[2]:
    print("No")
else:
    print("Yes")
S = input()

if S[0] == S[1] and S[1] == S[2]: print("No")
else: print("Yes")
S = input()
if S == "AAA":
    print("No")
elif S == "BBB":
    print("No")
else:
    print("Yes")
s = input()

if s.count("A")>=1:
    if s.count("B")>=1:
        print("Yes")
    else:
        print("No")
else:
    print("No")
a = input()
if a=="AAA" or a=="BBB":
  print("No")
else:
  print("Yes")
s = input()

if(s == "AAA" or s == "BBB"):
  print("No")
else:
  print("Yes")
s = input()
if s.count(s[0]) == 3:
    print("No")
else:
    print("Yes")
S=input()
if 'A' in S and 'B' in S:
    print("Yes")
else:
    print("No")
S = input()
ans = 'No'
if S[0] != S[1]:
    ans = 'Yes'
elif S[1] != S[2]:
    ans = 'Yes'
print(ans)
s = input()

if s=='AAA' or s=='BBB':
    print('No')
    exit()
print('Yes')
S = input()
set_S = set(S)
print('Yes' if len(set_S) == 2 else 'No')
s = input()
s = list(s)

if s[0] == s[1] == s[2]:
  print('No')
else:
  print('Yes')
S = input()
if len(S)==3 and S.count('A')==2 or S.count('B')==2:
    print('Yes')
else:
    print('No')
S = input()

if S.count("A") == 3 or S.count("B") == 3:
  print("No")
else:
  print("Yes")