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:
S = input()
print('No') if S in ['AAA', 'BBB'] else print('Yes')

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = str(input())


if S.count("A") > 0 and S.count("B") > 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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=="BBB" or S=="AAA":
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
N = str(input())
#N,K = map(int,input().split())
#X=list(map(int,input().split()))

if N[0]==N[1]==N[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:
# -*- coding: utf-8 -*-
s = input()

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

s = input()
S = {"A","B"}
s1 = {s[0],s[1]}
s2 = {s[2],s[1]}
if s1 == S or s2 == S:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
s = stdin.readline().rstrip()
if s[0] == s[1] == s[2]:
    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=input()
print("Yes" if len(set(S))==2 else "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=list(input())
t=set(s)
if len(t)==1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
a = set(input())
if len(a) == 1:
    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):
    print(NO if S[0] == S[1] and S[1] == S[2] else YES)


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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(S):
    return 'Yes' if len(set(S)) > 1 else 'No'


def main():
    S = read_str()
    print(slv(S))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

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

Submission status: Accepted

Solution code:
lst = len(list(set(list(map(str, input())))))

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

Submission status: Accepted

Solution code:
import sys, math
def input():
    return sys.stdin.readline()[:-1]
from itertools import permutations, combinations
from collections import defaultdict, Counter
from math import factorial
from bisect import bisect_left # bisect_left(list, value)
#from fractions import gcd
enu = enumerate

sys.setrecursionlimit(10**7)
S = 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') <= 2 and s.count('B') <= 2 else 'No')

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
# n = int(input())
# x, y = map(int, input().split())
# a = list(map(int, input().split()))
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]:
    print("Yes")
elif s[1] != s[2]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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

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



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def examA():
    S = SI()
    if S=="AAA" or S=="BBB":
        print("No")
    else:
        print("Yes")
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math,random
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**6)

if __name__ == '__main__':
    examA()

"""

"""

Submission status: Accepted

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

if s[0] == s[1] == s[2]:
    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()
print('No') if S in ['AAA','BBB'] 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:
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")

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()
t=S[0]
for i in S:
    if t!=i:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

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

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("No" if S in ['AAA', 'BBB'] else 'Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

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

Submission status: Accepted

Solution code:
s = input()
v = len(set(s))
if v==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:
import sys
def input(): return sys.stdin.readline().rstrip()
sys.setrecursionlimit(10 ** 7)

S = input()
ans = "No"
for i in range(2):
    if S[i] != S[i+1]:
        ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

if len(set_) == 2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

print('YNeos'[len(set(list(input()))) < 2::2])

Submission status: Accepted

Solution code:
s = input()


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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
s = set()
for x in S:
    s.add(x)
if len(s) == 2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=list(*input().split())

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

Submission status: Accepted

Solution code:
S = 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()
print("Yes" if s!="AAA" and s!="BBB" else "No")

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    import sys
    #input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

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



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#[int(i) for i in input().split()]
s = input()
if s.count("A") != 0 and s.count("B") != 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=list(input())
print("Yes")if len(set(s))>1 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:
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    S = input()
    if len(set(list(S))) > 1:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

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 sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n = input().split()[0]

a = n.count("A")

b = n.count("B")

if a == 3 or 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 = input()
if S not in ("AAA","BBB"):
    print("Yes")
else:print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

S = read().decode().rstrip()

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

Submission status: Accepted

Solution code:
s = input()
if len(set(list(s))) == 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:
#!/usr/bin/env python3
import sys

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


def solve(S: str):
    print(YES if 'A' in S and 'B' in S else 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:
N = input()

#A = map(int,input().split())

if N[0]==N[1]==N[2]:
    print('No')
    exit()
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

def intput():
	return int(input().rstrip())

def sinput():
	return input().rstrip().split()

def intsput():
	return map(int, sinput())

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


if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = [int(input()) for i in range(n)]
    #a = list(map(int, input().split()))
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    s =list(input())
    if s[0] == s[1] == s[2]:
        print("No")
    else:
        print("Yes")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
print('No' if S in ('AAA', 'BBB') else '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())

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

Submission status: Accepted

Solution code:
"""
// Author : snape_here - Susanta Mukherjee
     
"""
 
from __future__ import division, print_function
 
import os,sys
from io import BytesIO, IOBase
 
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
 
 
def ii(): return int(input())
def si(): return input()
def mi(): return map(int,input().split())
def li(): return list(mi())
 
 
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x
    
 
def read():
    sys.stdin = open('input.txt', 'r')  
    sys.stdout = open('output.txt', 'w') 
 
 
import math

mod=1000000007 

def main():

    s=si()
    if s.count('A') and s.count('B'):
        print("Yes")
    else:
        print("No")

# region fastio#
 
BUFSIZE = 8192
 
 
class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
 
def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()
 
 
if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
 
input = lambda: sys.stdin.readline().rstrip("\r\n")
 
# endregion
 
 
if __name__ == "__main__":
    #read()
    main() 
#Comment read()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import re
import math
import itertools
from copy import deepcopy
import fractions
import random
from functools import lru_cache
from heapq import heappop,heappush
import time
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(2000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s

#main
s=input()
Yn(len(set(s))!=1)

Submission status: Accepted

Solution code:
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7

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 S!='AAA' and S!='BBB' else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
print(['No','Yes'][not (S=="AAA" or S=='BBB')])

Submission status: Accepted

Solution code:
s = input()


cnt = 0
for i in range(3):
    if s[i] == "A":
        cnt += 1

if cnt == 3 or cnt == 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S = input()

ans = 'No'
if 'A' in S and 'B' in S:
    ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
S = str(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math

import itertools

#import bisect

import copy
from functools import lru_cache

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]



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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#A, B = map(int,input().split())
S = input()
if S == "AAA" or S == "BBB":
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

S = input()
if S == 'AAA' or S == 'BBB':
    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:
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')

Submission status: Accepted

Solution code:
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

S = input()

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

Submission status: Accepted

Solution code:
s = input()
before_c = ""
for c in s:
    if(before_c != "" and before_c != c):
        print("Yes")
        break
    before_c = c
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 S[0] == S[1] == S[2]:
        print(NO)
    else:
        print(YES)
    return


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

Submission status: Accepted

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


S = input()

a = S.count('A')
b = S.count('B')
if a==0 or b==0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
import sys
import math
import bisect

def main():
    s = input()
    if 'A' in s and 'B' 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')