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:
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

class UnionFindEx:
    def __init__(self, size):
        #正なら根の番号、負ならグループサイズ
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   #負なら根
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    #サイズ更新
        self.roots[r2] = r1
        return True

def main():
    S=input()
    if 'AB' in S or 'BA' in S:
        print('Yes')
    else:
        print('No')

main()

Submission status: Accepted

Solution code:
S = input().strip()

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

Submission status: Accepted

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S=list(input())

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

Submission status: Accepted

Solution code:
S = input()

if 'AB' in S:
    print('Yes')
elif 'BA' in S:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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 'AB' in s or 'BA' in s:
   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()
if len(set(S)) == 1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
s = str(stdin.readline().rstrip())
#l = list(map(int, stdin.readline().rstrip().split()))
#A, B, C = map(int, stdin.readline().rstrip().split())
#S = [list(map(int, stdin.readline().rstrip().split())) for _ in range(h)]#hの定義を忘れずに
if s[0]==s[1]==s[2]:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

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


def solve(S: str):
    if S=='AAA' or S=='BBB':
        print(NO)
    else:
        print(YES)
    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 = set(list(input()))
if len(S)==1:
    print("No")
else:
    print("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 = input()
# n, m = map(int, input().split())

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

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:
s=input()
if s == "AAA":
  print("No")
elif s == "BBB":
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
input = raw_input

s = input()
if "A" in s and "B" in s:
    out = "Yes"
else:
    out = "No"

print(out)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
S = input()
s = [S[0],S[1],S[2]]

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

Submission status: Accepted

Solution code:
import sys
import math
import bisect
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


# A
def A():
    S = input()
    if S == 'AAA' or S == 'BBB':
        print('No')
    else:
        print('Yes')
    return


# B
def B():
    return


# C
def C():
    return


# D
def D():
    return


# E
def E():
    return


# F
def F():
    return


# Solve
if __name__ == "__main__":
    A()

Submission status: Accepted

Solution code:
s = input()
if 'AB' in s or 'BA' in s:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import heapq
from collections import deque
from enum import Enum
import sys
import math
from _heapq import heappush, heappop

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001


#入力
s=input()
#n=int(input())
#a,b=map(int,input().split())
#l=list(map(int,input().split()))

#2次元配列
#2dimls=[[0 for i in range(2)] for j in range(n)]

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

Submission status: Accepted

Solution code:
S = list(input())
if S.count('A') >= 1 and S.count('B') >= 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = list(input())

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

else:
    print("No")

Submission status: Accepted

Solution code:
# A - Station and Bus

S = str(input())

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

Submission status: Accepted

Solution code:
S = input()
if abs(S.count("A") - S.count("B")) == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = set(input())

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

Submission status: Accepted

Solution code:
S=input()
L=[0,0]
for i in range(3):
    if S[i]=="A":
        L[0]+=1
    else:
        L[1]+=1
if max(L)==3:
    print("No")
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:
from sys import stdin

s = stdin.readline().rstrip()
print("No" if (s == "AAA") or (s == "BBB") else "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 itertools import accumulate, permutations, combinations, product, combinations_with_replacement, groupby
from math import sqrt, factorial, log
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heappushpop
import sys
stdin = sys.stdin
mod = 10**9 + 7

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

s = ns()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    S = input()
    if len(set(S)) == 1:
        print('No')
    else:
        print('Yes')



main()

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(list(S))) == 1:
        print(NO)
    else:
        print(YES)
    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:
from collections import defaultdict
from collections import deque
from string import ascii_uppercase
import sys, bisect, math, heapq

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

S = read_str()

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

if __name__ == "__main__":
    print(solve())

Submission status: Accepted

Solution code:
s = input()
if s.count("A") == 3 or s.count("B") == 3:
    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:
s = input()
ans = s.count('A') % 3
if(ans==0):
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

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()
print('Yes' if S.count('A') and S.count('B') else 'No')

Submission status: Accepted

Solution code:
s = input()
prev = s[0]
for si in s:
    if prev != si:
        print("Yes")
        exit()

print("No")

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 = input()
if s.count("A") == 0 or s.count("B") == 0:
    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 'AB' in S or 'BA' in S:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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:
same = ["AAA", "BBB"]
if input() in same:
    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")
    return

if __name__ == "__main__":
    main()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

for i in range(1,3):
	if s[i] != s[0]:
		print("Yes")
		exit()
print("No")

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
print('No') if(S.count('A') == 3 or S.count('B') == 3) 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-*--

S = input()

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

Submission status: Accepted

Solution code:
from collections import Counter

C = Counter(input())

print(["No","Yes"]['A' in C and 'B' in C])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

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 'A' in S and 'B' in S:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = str(input())
for i in range(2):
    if s[i] != s[i+1]:
        print('Yes')
        exit()
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  s=list(S())
  s=set(s)

  if len(s)==1:
    return 'No'
  return 'Yes'

# main()
print(main())

Submission status: Accepted

Solution code:
S = str(input())

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

Submission status: Accepted

Solution code:
from sys import stdin
def main():
    readline=stdin.readline
    s=readline().strip()
    flagA=False
    flagB=False
    for i in range(len(s)):
        if s[i]=="A":
            flagA=True
        else:
            flagB=True
    if flagA and flagB:
        print("Yes")
    else:
        print("No")

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

S=one_str()

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

Submission status: Accepted

Solution code:
import sys
import math
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()

print('Yes') if len(set(S))==2 else print('No')

Submission status: Accepted

Solution code:
import sys
import math
import collections
#n = int(input())
#n, m = map(int, input().split())
s = input()
#x = list(map(int, input().split()))

if s[0] == s[1]:
    if s[1] == s[2]:
        print("No")
        sys.exit()

print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

S = list(input())

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

print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s=input()
import sys
buf=s[0]
if buf==s[1] and buf==s[2]:
    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:
s = input()
print("Yes" if ('A' in s and 'B' in s) else "No")

Submission status: Accepted

Solution code:
import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29

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

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
#n,m = list(map(int,input().split()))
s = input()

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

Submission status: Accepted

Solution code:
#n=int(input())
#a,b=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

s=list(input())

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

Submission status: Accepted

Solution code:
s = input()

ss = set(s)

if len(ss) == 1:
    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:
import sys
sys.setrecursionlimit(4100000)

import math

import logging

logging.basicConfig(level=logging.DEBUG)

logger = logging.getLogger(__name__)


def resolve():
    S = [x for x in sys.stdin.readline().split()][0]  # 文字列 一つ
    # N = [int(x) for x in sys.stdin.readline().split()][0]  # int 一つ
    # N, D = [int(x) for x in sys.stdin.readline().split()]  # 複数int
    # h_list = [int(x) for x in sys.stdin.readline().split()]  # 複数int

    # grid = [list(sys.stdin.readline().split()[0]) for _ in range(N)]  # 文字列grid
    # v_list = [int(sys.stdin.readline().split()[0]) for _ in range(N)]
    # grid = [[int(x) for x in sys.stdin.readline().split()]
    #         for _ in range(N)]  # int grid

    logger.debug('{}'.format([]))

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


if __name__ == "__main__":
    resolve()

# AtCoder Unit Test で自動生成できる, 最後のunittest.main は消す
# python -m unittest template/template.py で実行できる
# pypy3 -m unittest template/template.py で実行できる
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """ABA"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """BBA"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """BBB"""
        output = """No"""
        self.assertIO(input, output)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def resolve():
    S = sr()
    if S == 'AAA' or S == 'BBB':
        print('No')
    else:
        print('Yes')
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def main():
    s = input()
    a = False
    b = False
    for i in range(3):
        if s[i] == 'A':
            a = True
        if s[i] == 'B':
            b = True
    if a and b:
        print('Yes')
    else:
        print('No')
    
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

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


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
hoge=input()
if(hoge=="AAA"):
  print("No")
elif(hoge=="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()

if("A" not in s or "B" not in s):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S=input()
ans=[]
for i in range(3):
    ans.append(S[i])
if len(set(ans))!=1:
    print("Yes")
else:
    print("No")

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:
def resolve():
    s=list(input())
    if len(set(s))==1:
        print('No')
    else:
        print('Yes')

resolve()

Submission status: Accepted

Solution code:
def solve(s):
    if s == "AAA" or s == "BBB":
        return "No"
    else:
        return "Yes"


def main():
    s = input()
    res = solve(s)
    print(res)


def test():
    assert solve("ABA") == "Yes"
    assert solve("BBA") == "Yes"
    assert solve("BBB") == "No"


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input().strip()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

s=input()

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

if s.count('AB') >= 1 or s.count('BA') >= 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

S = list(input())

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

else:
    print('No')

Submission status: Accepted

Solution code:
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time


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


def S(): return input()


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


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YNL = {False: 'No', True: 'Yes'}
YNU = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False
# show_flg = True


def main():
    s = S()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

# n = int(input())
# a, b = list(map(int, input().split()))
# 

s = input()
if "A" in s and "B" in s:
    print("Yes")
else:
    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();print(["No","Yes"][len(set(s))-1])

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())
if(len(set(s))==1):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

import sys
from collections import Counter

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

S = input()

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

Submission status: Accepted

Solution code:
s = input()
if all((s[0] == i for i in s)):
    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()
if S == "AAA" or S=="BBB":
    print("No")
else:print("Yes")

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 = set(input())
print('No' if len(s) == 1 else 'Yes')

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
if S in ["AAA", "BBB"]:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
Ss = input()

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

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

S = input()

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