When the curtains are opened, a canvas unfolds outside. Kanno marvels at all the blonde colours along the riverside — not tangerines, but blossoms instead."What a pity it's already late spring," sighs Mino with regret, "one more drizzling night and they'd be gone.""But these blends are at their best, aren't they?" Absorbed in the landscape, Kanno remains optimistic. The landscape can be expressed as a row of consecutive cells, each of which either contains a flower of colour amber or buff or canary yellow, or is empty.When a flower withers, it disappears from the cell that it originally belonged to, and it spreads petals of its colour in its two neighbouring cells (or outside the field if the cell is on the side of the landscape). In case petals fall outside the given cells, they simply become invisible.You are to help Kanno determine whether it's possible that after some (possibly none or all) flowers shed their petals, at least one of the cells contains all three colours, considering both petals and flowers. Note that flowers can wither in arbitrary order.

The first and only line of input contains a non-empty string $$$s$$$ consisting of uppercase English letters 'A', 'B', 'C' and characters '.' (dots) only ($$$\lvert s \rvert \leq 100$$$) — denoting cells containing an amber flower, a buff one, a canary yellow one, and no flowers, respectively.

Output "Yes" if it's possible that all three colours appear in some cell, and "No" otherwise. You can print each letter in any case (upper or lower).

NoteIn the first example, the buff and canary yellow flowers can leave their petals in the central cell, blending all three colours in it.In the second example, it's impossible to satisfy the requirement because there is no way that amber and buff meet in any cell.

s = raw_input()

if "ABC" in s or "ACB" in s or "BAC" in s or "BCA" in s or "CBA" in s or "CAB" in s:
	print "Yes"
else:
	print "No"

def check(s):
    i = 0
    while i < len(s) - 2:
        x = ''.join(sorted(s[i:i + 3]))
        if 'ABC' == x:
            return True
        i += 1

    return False

if __name__=='__main__':
    s = input().strip()

    if check(s):
        print('Yes')
    else:
        print('No')

s1=input();
if(("ABC" in s1)  or ("ACB" in s1) or("BAC" in s1) or ("BCA" in s1) or ("CAB" in s1) or("CBA" in s1)):
	print('Yes');
else:
	print('No');

word = str(input())
if "BAC" in word:
    print("Yes")
elif "ABC" in word:
    print("Yes")
elif "BCA" in word:
    print("Yes")
elif "ACB" in word:
    print("Yes")
elif "CAB" in word:
    print("Yes")
elif "CBA" in word:
    print("Yes")
else:
    print("No")

s = input()
flag = True
for i in range(len(s)):
        s2 = s[i:i+3]
        if(s2=='ABC' or s2=='ACB' or s2=='BAC' or s2=='BCA' or s2=="CAB" or s2=='CBA'):
            print("Yes")
            flag = False
            break
if(flag):
    print("NO")

s = input()

for i in range(len(s) - 2):

    flowers = set()

    for j in range(i, i+3):
        if s[j] != '.':
            flowers.add(s[j])

    if len(flowers) == 3:
        print("Yes")
        break
else:
    print("No")

def solve(s):
  for i in range(len(s) - 2):
    if ''.join(sorted(s[i:i+3])) == 'ABC':
      return 'Yes'
  return 'No'

s = input()
print(solve(s))

s = input();
flag=0
for i,c in enumerate(s):
    if i==0:
        continue
    elif i==len(s)-1:
        continue
    else:
        l=[]
        if s[i-1]!='.' and s[i+1]!='.' and s[i]!='.':
            l.append(s[i-1])
            l.append(s[i+1])
            l.append(c)
            if len(set(l))==3:
                flag=1
                break

if flag==0:
    print("No")
else:
    print("Yes")

s = input().strip()
ans = 'No'
for i in range(1, len(s) - 1):
    if ord(s[i]) + ord(s[i - 1]) + ord(s[i + 1]) == 198 and s[i] != s[i - 1] and s[i] != s[i + 1] and s[i - 1] != s[i + 1]:
        ans = 'Yes'
print(ans)

# https://codeforces.com/problemset/problem/989/A
# 900

c = input()

o = "NO"
for i in range(len(c)):
    x = {}
    for f in c[i:i+3]:
        if f != ".":
            x[f] = 1

    if len(x) == 3:
        o = "YES"
        break

print(o)

s = input()
print('Yes' if any(set(s[i:i+3]) == set('ABC') for i in range(len(s) - 2))
            else 'No')

import sys
s = sys.stdin.readline().strip()
print('Yes' if any(x in s for x in ['ABC', 'ACB', 'BCA', 'BAC', 'CAB', 'CBA']) else 'No')

s = input()
flag = True
for i in range(len(s)-2):
        s2 = s[i:i+3]
        if(s2=='ABC' or s2=='ACB' or s2=='BAC' or s2=='BCA' or s2=="CAB" or s2=='CBA'):
            print("Yes")
            flag = False
            break
if(flag):
    print("NO")

a = raw_input()
print 'Yes' if set('ABC') in map(set, zip(a, a[1:], a[2:])) else 'No'

#n=map(int,raw_input().split())
import re
s=raw_input()
if(re.search("BAC",s)or re.search("BCA",s)or re.search("ABC",s)or re.search("ACB",s)or re.search("CAB",s)or re.search("CBA",s) ):
    print "Yes"
else:
    print "No"

s = input()

lens = int(len(s))

for i in range(lens - 2):

    se = set(s[i:i+3])
    # print(se)
    if se.__len__() == 3 and '.' not in se:
        print('Yes')
        break
else:
    print('No')

s = input()
n = len(s)
k = [0]*n
for i in range(n):
    t = 0
    if s[i] == 'A':
        t = 1
    elif s[i] == 'B':
        t = 2
    elif s[i] == 'C':
        t = 4

    if i - 1 >= 0 and k[i - 1] != t:
        k[i - 1] += t

    k[i] += t

    if i + 1 < n and k[i + 1] != t:
        k[i + 1] += t

if 7 in k:
    print("Yes")
else:
    print("No")

cells = input()
answer = "No"
for i in range(1, len(cells) - 1):
	potential_colors = set()
	potential_colors.update(cells[i-1 : i+2])
	if len(potential_colors) == 3 and '.' not in potential_colors:
		answer = "Yes"
		break

print(answer)

dc=['ABC','ACB','BAC','BCA','CAB','CBA']
for s in input().split('.'):
    for d in dc:
        if s.find(d)!=-1:
            print('Yes')
            exit()
print('No')

import math as mt
import sys, string
from collections import Counter, defaultdict

I = lambda : int(input())
M = lambda : map(int, input().split())
ARR = lambda: list(map(int, input().split()))

def printARR(arr):
    for e in arr:
        print(e, end=" ")
    print()

def main():
    s = input()
    n = len(s)
    arr = [[] for _ in range(n)]
    for i in range(n):
        if i-1>=0:
            arr[i-1].append(s[i])
        if i+1<n:
            arr[i+1].append(s[i])
        arr[i].append(s[i])
    for elm in arr:
        if 'A' in elm and 'B' in elm and 'C' in elm:
            print("Yes")
            return
    print("No")
    return

tc = 1
# tc = I()
for _ in range(tc):
    main()

row = input()
length = len(row)
if length < 3:
    print("No")
else:
    found = False
    for index in range(1, length - 1):
        if (row[index - 1] != '.') and (row[index] != '.') and (row[index + 1] != '.') and (row[index - 1] != row[index]) and (row[index - 1] != row[index + 1]) and (row[index] != row[index + 1]):
            print("Yes")
            found = True
            break
    if not found:
        print("No")

s = raw_input()
p = ["ABC", "ACB", "BAC", "BCA", "CAB", "CBA"]
res = False
for i in p:
    if i in s:
        res = True
        break

if res:
    print "Yes"
else:
    print "No"

s=input()
print('Yes'if any(sorted(s[i:i+3])==['A','B','C'] for i in range(len(s)))else'No')

II = lambda: int(raw_input())
IAI = lambda: map(int, raw_input().split())
IL = lambda: raw_input().strip()
IAS = lambda: raw_input().split()
s = IL()
a = any(w in s for w in ('ABC','ACB','BAC','BCA','CAB','CBA'))
print ("No","Yes")[a]

s = raw_input()
if "ABC" in s:
	print "Yes"
	exit(0)
if "ACB" in s:
	print "Yes"
	exit(0)
if "BAC" in s:
	print "Yes"
	exit(0)
if "BCA" in s:
	print "Yes"
	exit(0)
if "CAB" in s:
	print "Yes"
	exit(0)
if "CBA" in s:
	print "Yes"
	exit(0)
print "No"

s=input()
l=["ABC", "ACB", "BAC", "BCA", "CAB", "CBA"]
for x in l:
    if x in s:
        print("YES")
        exit(0)
print("NO")

# -*- coding:utf-8 -*-
#[n, m] = [int(x) for x in raw_input().split()]

def some_func():
    """
    """
    n_str = raw_input()
    cache = ["ABC","ACB","BAC","BCA","CAB","CBA"]
    for v in cache:
        if v in n_str:
            return "yes"
    return "no"

if __name__ == '__main__':
    print  some_func()

a=input()
if 'ABC' in a:
    print('Yes')
elif 'ACB' in a:
    print('Yes')
elif 'BCA' in a:
    print('Yes')
elif 'BAC' in a:
    print('Yes')
elif 'CAB' in a:
    print('Yes')
elif 'CBA' in a:
    print('Yes')
else:
    print('No')

a = raw_input()
l = len(a)
arr = []
flag = 0
for x in a:
    if(len(arr)>=3):
        arr = arr[1:]
    arr.append(x)
    if ( 'A' in arr and 'B' in arr and 'C' in arr):
        print 'Yes'
        flag = 1
        break
if(flag==0):
    print'No'

a = list(input())
n = ['B', 'A', 'C']
for k in range(len(a)):
    if a[k] in n and k < len(a)-1 and k > 0:
        if a[k-1] in n and a[k+1] in n:
            if a[k-1] != a[k+1] and a[k-1] != a[k] and a[k] != a[k+1]:
                print('Yes')
                break
else:
    print('No')

import itertools
seq = input()
for subseq in itertools.permutations('ABC'):
    if ''.join(subseq) in seq:
        print('Yes')
        quit()
print('No')

test = input()
bull = True

def summString(a, b, c):
    return a+b+c

for i in range(1, len(test)-1):
    partString = summString(test[i-1], test[i], test[i+1])
    if (partString == 'ABC' or
            partString == 'BAC' or
            partString == 'BCA' or
            partString == 'CBA' or
            partString == 'ACB' or
            partString == 'CAB'):
        print('Yes')
        bull = False
        break

if bull:
    print('No')

s = input()
print(('No', 'Yes')[any(set(s[i:i+3]) == set('ABC') for i in range(len(s) - 2))])

s=input()
for i in range(len(s)-1):
    if i and s[i]!=s[i-1] and s[i]!=s[i+1] and s[i-1]!=s[i+1] and s[i-1]!='.' and s[i]!='.' and s[i+1]!='.'   :
       print("Yes")
       exit(0)
print("No")

import sys
s=input()
if len(s)<3:
    print('No')
    sys.exit()
for i in range(len(s)-2):
    if (s[i:(i+3)]=='ABC')or(s[i:(i+3)]=='ACB')or(s[i:(i+3)]=='BAC')or(s[i:(i+3)]=='BCA')or(s[i:(i+3)]=='CBA')or(s[i:(i+3)]=='CAB'):
        print('Yes')
        break
    else:
        if i==len(s)-3:
            print('No')

s = input()
a = ['ABC', 'ACB', 'BCA', 'BAC', 'CAB', 'CBA']
for i in a:
    if i in s:
        print('YES')
        exit()
print('NO')

garden = raw_input()

possible = False

for i in range ( 1, len(garden) - 1 ) :
    if garden[i] == 'A' and garden[i-1] == 'B' and garden[i+1] == 'C':
        possible = True
        break
    elif garden[i] == 'A' and garden[i-1] == 'C' and garden[i+1] == 'B':
        possible = True
        break
    elif garden[i] == 'B' and garden[i-1] == 'A' and garden[i+1] == 'C':
        possible = True
        break
    elif garden[i] == 'B' and garden[i-1] == 'C' and garden[i+1] == 'A':
        possible = True
        break
    elif garden[i] == 'C' and garden[i-1] == 'A' and garden[i+1] == 'B':
        possible = True
        break
    elif garden[i] == 'C' and garden[i-1] == 'B' and garden[i+1] == 'A':
        possible = True
        break

if  possible:
    print "Yes"
else :
    print "No"

a = input()
sub = ['ABC', 'ACB', 'BAC', 'BCA', 'CAB', 'CBA']
count = -1
for i in sub:
    count = max(a.find(i), count)

if count == -1:
    print("NO")
else:
    print("YES")

s = list(input())

k = list(s)

n = len(s)
for i in range(0,n):
    if ((s[i]=='A')or(s[i]=='B')or(s[i]=='C')):
        if i!=0:
            k[i-1] = k[i-1]+s[i]
        if i!= n-1:
            k[i+1] = k[i+1] + s[i]
count = 0
for x in k:
    if ((x=='ABC')or(x=='BAC')or(x=='BCA')or(x=='ACB')or(x=='CAB')or(x=='CBA')):
        count = 1
        break
if count != 0:
    print('Yes')
else:
    print('No')

import sys

s = input()
b = ["ABC", "ACB", "BAC", "BCA", "CAB", "CBA"]
for i in b:
    if s.find(i) != -1:
        print("Yes")
        sys.exit()
print("No")

s = list(set(input().split(".")))
l = ["ABC", "ACB", "BCA", "BAC", "CBA", "CAB"]
for i in s:
    for j in l:
        if j in i:
            print("Yes")
            exit(0)
print("No")

n=list(input())
po=["A","B","C"]
to=0
for x in range(len(n)-2):
    tan=n[x:x+3]
    tan.sort()
    if "".join(tan)=="".join(po):
        print("Yes")
        to=1
        break
    else:
        pass
if to==0:
    print("NO")

s = raw_input()
p = ["ABC", "ACB", "BAC", "BCA", "CAB", "CBA"]
res = False
for i in p:
    if i in s:
        res = True
        break

if res:
    print "Yes"
else:
    print "No"

def test(string):

  length = len(string)
  for i in range(0,length-2):
    if string[i:i+3] == "ABC" or string[i:i+3] == "BAC" or string[i:i+3] == "CAB" or string[i:i+3] == "ACB" or string[i:i+3] == "BCA" or string[i:i+3] == "CBA":
      print("Yes")
      return
  print("No")

if __name__ == '__main__':
    string = input()
    test(string)

s = list(input())

colors = []
res = 'No'

for x in range(len(s)):
    if s[x] != '.':
        if  not(s[x] in colors):
            colors.append(s[x])

if len(colors) < 3:
    res = 'No'
else:
    for x in range(1, len(s) - 1):
        if s[x-1] != '.' and s[x] != '.' and s[x+1] != '.':
            if s[x-1] != s[x] and s[x] != s[x+1] and s[x-1] != s[x+1]:
                res = 'Yes'
                break
print(res)

#n,m = map(int,raw_input().split())

#A = map(int,raw_input().split())
#B = map(int,raw_input().split())

s=raw_input()
s=list(s)

n=len(s)
if n<=2:
    print 'NO'
else:
    flg=False
    for i in range(1,n-1):
        dic={}
        dic['A'],dic['B'],dic['C']=False,False,False
        for k in range(i-1,i+2):
            dic[s[k]]=True
        if dic['A'] and dic['B'] and dic['C']:
            flg=True
            print 'YES'
            break
    if not flg:
        print 'NO'

s = raw_input()
if 'ABC' in s or 'BAC' in s or 'ACB' in s or 'BCA' in s or 'CBA' in s or 'CAB' in s:
    print "Yes"
else:
    print "No"

from sys import stdin, stdout

x=str(stdin.readline().strip())

L=["ABC","BAC","CAB","BCA","CBA","ACB"]
b=0
for i in L:
    if(x.find(i)!=-1):

        b=1
if(b==0):
    print "No"
else:
    print "Yes"

""" https://codeforces.com/problemset/problem/989/A """

flowers = input ()

is_possible = False
if len ( flowers ) >= 3:
    for i in range ( 1, len ( flowers ) - 1 ):
        current_color = flowers [ i ]
        prev_color = flowers [ i - 1 ]
        next_color = flowers [ i + 1 ]
        if (
            current_color != '.' and
            prev_color != '.' and
            next_color != '.' and
            current_color != prev_color and
            current_color != next_color and
            prev_color != next_color
        ):
            is_possible = True

print ( 'YES' if is_possible else 'NO' )

s = input()
n = len(s)
f = 0
for i  in range(n - 2):
		if s[i] != '.' and s[i+1] != '.' and s[i+2] != '.':
				if s[i+1] != s[i]:
						if s[i+2] != s[i] and s[i+2] != s[i + 1]:
								f = 1
								break

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

#n=map(int,raw_input().split())
import re
s=raw_input()
if(re.search("BAC",s)or re.search("BCA",s)or re.search("ABC",s)or re.search("ACB",s)or re.search("CAB",s)or re.search("CBA",s) ):
    print "Yes"
else:
    print "No"

n = raw_input()

if(n.find("ABC")>=0 or n.find("ACB")>=0 or n.find("BCA")>=0 or n.find("BAC")>=0 or n.find("CAB")>=0 or n.find("CBA")>=0):
    print "Yes"
else:
    print "No"

a = raw_input()
l = len(a)
arr = []
flag = 0
for x in a:
    if(len(arr)>=3):
        arr = arr[1:]
    arr.append(x)
    if ( 'A' in arr and 'B' in arr and 'C' in arr):
        print 'Yes'
        flag = 1
        break
if(flag==0):
    print'No'

test = input()

for i in range(1, len(test)-1):
    partString = test[i-1]+test[i]+test[i+1]
    if 'A' in partString and 'B' in partString and 'C' in partString:
        print("Yes")
        exit(0)

print("No")

'''input
.BAC.
'''

#~ @author = dwij28 (Abhinav Jha) ~#

s = raw_input()
ans = False
for i in xrange(1, len(s)-1):
	if s[i] != '.' and s[i-1] != '.' and s[i+1] != '.' and s[i] != s[i-1] and s[i] != s[i+1] and s[i-1] != s[i+1]:
		ans = True
print 'Yes' if ans else 'No'

s = raw_input()
l = ["ABC", "ACB", "BAC", "BCA", "CAB", "CBA"]
yeah = 0
for st in l:
    if st in s:
        yeah = 1
        break
if yeah: print "Yes"
else: print "No"

import re

s = raw_input()

pattern = "(ABC|ACB|BCA|BAC|CBA|CAB)"
result = re.search(pattern, s)

print "Yes" if s != "" and result is not None else "No"

#!/usr/bin/env python

def get_array(data_type=int):
	return [data_type(num) for num in raw_input().split()]

def get(data_type=int):
	return data_type(raw_input())

A = raw_input()

poss =  False

for i in range(1, len(A) - 1):
	s = {A[i-1], A[i+1], A[i]}
	if len(s) == 3 and '.' not in s:
		poss =  True

print "Yes" if poss else "No"

s = input()
n = len(s)
ans = 'No'
for i in range(2, n):
    if set(list(s[i - 2 : i + 1])) == set(['A','B','C']):
        ans = 'Yes'
        break
print(ans)

string_input = input()
if "ABC" in string_input:
    print("Yes")
elif "ACB" in string_input:
    print("Yes")
elif "CAB" in string_input:
    print("Yes")
elif "CBA" in string_input:
    print("Yes")
elif "BAC" in string_input:
    print("Yes")
elif "BCA" in string_input:
    print("Yes")
else:
    print("NO")

n=input()
a=0
for i in range(1,len(n)-1):
    if n[i]!="." and n[i-1]!="." and n[i+1]!="." and n[i]!=n[i+1] and n[i]!=n[i-1] and n[i-1]!=n[i+1]:
        print("Yes")
        a=1
        break
if a==0:
    print("NO")

s = input()

count = 0
for i in range(1, len(s)-1):
	if s[i] != '.' and s[i+1] != '.' and s[i-1] != '.':
		if s[i-1] != s[i] and s[i] != s[i+1] and s[i+1] != s[i-1]:
			count += 1

if count > 0:
	print("Yes")
else:
	print("No")

f = raw_input()

if f.find('ABC') == -1 and f.find('CAB') == -1 and f.find('BCA') == -1 and f.find('CBA') == -1 and f.find('BAC') == -1 and f.find('ACB') == -1:
    print 'No'
else:
    print 'Yes'

s = input().strip()
ans = 'No'
for i in range(1, len(s) - 1):
    if ord(s[i]) + ord(s[i - 1]) + ord(s[i + 1]) == 198 and s[i] != s[i - 1] and s[i] != s[i + 1] and s[i - 1] != s[i + 1]:
        ans = 'Yes'
print(ans)

s = input()
flag = False
for i in range(0, len(s) - 2):
    if s[i:i+3] in ("ABC", "BAC", "BCA", "CAB", "ACB", "CBA"):
        flag = True
        break
if flag:
    print("Yes")
else:
    print("No")

s = input()
print(('No', 'Yes')[any(set(s[i:i+3]) == set('ABC') for i in range(len(s) - 2))])

s = raw_input()
comb = ord('A') * ord('B') * ord('C')
flag =False
for i in range(0 , len(s) - 2 ):
    if ord(s[i]) * ord(s[i + 1]) * ord(s[i + 2]) == comb:
        flag=True
        break
if flag:
    print 'Yes'
else:
    print 'No'

a = input(); print("YES" if "ABC" in a or "ACB" in a or "BAC" in a or "BCA" in a or "CAB" in a or "CBA" in a else "NO")

k=input()
s=[]
for i in k:
    s.append(i)
t=[]
flag=0
for i in range(len(s)-2):
    t=s[i:i+3]
    t.sort()
    if(t==["A","B","C"]):
        flag=1
        break
if(flag==1):
       print("Yes")
else:
    print("No")

n=input()
l=len(n)
if(l<3):
    print("No")
else:
    i=0
    j=1
    k=2
    flag=0
    while(k<l):
        if((n[i]=="A" and n[j]=="B" and n[k]=="C") or (n[i]=="A" and n[j]=="C" and n[k]=="B") or (n[i]=="B" and n[j]=="A" and n[k]=="C") or (n[i]=="B" and n[j]=="C" and n[k]=="A") or (n[i]=="C" and n[j]=="A" and n[k]=="B") or (n[i]=="C" and n[j]=="B" and n[k]=="A") ):
            flag=1
            break
        else:
            i=i+1
            j=j+1
            k=k+1
    if(flag==1):
        print("Yes")
    else:
        print("No")

s = input()

for i in range(len(s) - 2):
     st = s[i:i+3]
     if ''.join(sorted(st)) == 'ABC':
          print('Yes')
          exit(0)

print('No')

from itertools import permutations

if __name__ == "__main__":
    l = raw_input()
    if any([s in l for s in ["".join(p) for p in permutations("ABC")]]):
        print("Yes")
    else:
        print("No")

n=list(input())
po=["A","B","C"]
to=0
for x in range(len(n)-2):
    tan=n[x:x+3]
    tan.sort()
    if "".join(tan)=="".join(po):
        print("Yes")
        to=1
        break
    else:
        pass
if to==0:
    print("NO")
else:
    pass

s = input().split(".")
count = 0

for i in s:
    if("ABC" in i or "ACB" in i or "BAC" in i or "BCA" in i or "CAB" in i or "CBA" in i):
        count += 1
        print("Yes")
        break
if(count == 0):
    print("No")

s = list(input())
def check(s):
  for i in range(len(s)-2):

    if set(s[i:i+3])=={'A','B', 'C'}:
      return('Yes')
  return('No')
print(check(s))

a=input()
if a.find("ABC")>=0 or a.find("CAB")>=0 or a.find("BAC")>=0 or a.find("ACB")>=0 or a.find("CBA")>=0 or a.find("BCA")>=0:
    print("Yes")
else:
    print("No")

s=raw_input()
s1,s2,s3,s4,s5,s6='ABC','ACB','BAC','BCA','CAB','CBA'
if(s1 in s or s2  in s or s3  in s or s4  in s or s5  in s or s6  in s):
    print "Yes"
else:
    print "No"

z=input()
if 'ABC' in z:
	print('Yes')
	quit()
if 'CBA' in z:
	print('Yes')
	quit()
if 'BCA' in z:
	print('Yes')
	quit()
if 'ACB' in z:
	print('Yes')
	quit()
if 'BAC' in z:
	print('Yes')
	quit()
if 'CAB' in z:
	print('Yes')
	quit()
print('No')

from itertools import permutations

s = input()
print(('No', 'Yes')[any([''.join(t) in s for t in permutations('ABC', 3)])])

a = raw_input().split(".")
flag = False
for i in range(len(a)) :
               if("ABC" in a[i] or "ACB" in a[i] or "BAC"  in a[i] or "BCA" in a[i] or "CAB" in a[i] or "CBA" in a[i]) :
                  flag = True
if(flag) :
  print "YES"
else :
  print "NO"

s = input()
a = ['ABC', 'ACB', 'BAC', 'BCA', 'CAB', 'CBA']
print (['No', 'Yes'][any(i in s for i in a)])

s, t = input(), set('ABC')
print('Yes' if any(set(s[i:i+3]) == t for i in range(len(s) - 2)) else 'No')

s = input()
ans = ""
if len(s) < 3:
	print("NO")
	exit()
for i in range(len(s) - 3):
	if len(set(s[i] + s[i + 1] + s[i + 2])) == 3 and "." not in set(s[i] + s[i + 1] + s[i + 2]):
		ans = "YES"
if len(set(s[-1] + s[-2] + s[-3])) == 3 and "." not in set(s[-1] + s[-2] + s[-3]):
	ans = "YES"
if ans == "":
	print("NO")
else:
	print(ans)

from sys import stdin
a = stdin.readline().strip()
n = len(a)
a += '....'
ans = 'No'
for i in xrange(n):
    s = a[i: i+3]
    if '.' not in s and len(set(list(s)))==3:
        ans = 'Yes'
print ans

s=input()
ct=0
if len(s)>0:
    for i in range(len(s)-2):
        p=s[i:i+3]
        #print(p,int(p=='BAC')==1)
        if p=="ABC":
            print("Yes")
            ct+=1
            break
        elif p=="BAC":
            print("Yes")
            ct+=1
            break
        elif p=="CAB":
            print("Yes")
            ct+=1
            break
        elif p=="ACB":
            print("Yes")
            ct+=1
            break
        elif p=="CBA":
            print("Yes")
            ct+=1
            break
        elif p=="BCA":
            print("Yes")
            ct+=1
            break
    if ct==0:
        print("No")

s = input()
n = len(s) - 2
i = 0
x = ord('A') + ord('B') + ord('C')
err = 0
while i < n and err != 1:
    if ord(s[i]) + ord(s[i + 1]) + ord(s[i + 2]) == x:
        err = 1
    i += 1
if err == 0:
    print("NO")
else:
    print("YES")

a=input()
b=[]
for i in a:
    b.append(i)
for il in b:
    if il[0]!='.':
        s=b.index(il)
        if s==0:
            b[s+1]+=il[0]
        elif s==len(b)-1:
            b[s-1]+=il[0]
        else:
            b[s+1]+=il[0]
            b[s-1]+=il[0]
k=0
for i in b:
    if 'B' in i:
        if 'A'in i:
            if 'C' in i:
                k=1
if k==1:
    print('Yes')
else:
    print('No')

a = input()
i = 0
while i < len(a):
    x = a[i:i+3]
    print(x)
    if x == 'ABC' or x == 'ACB' or x == 'BAC' or x == 'BCA' or x == 'CAB' or x == 'CBA':
        print('YES')
        break
    i += 1

if i >= len(a):
    print("NO")

a = raw_input()
z=1
i=0
l=[]
x = "No"
while z==1 and i<len(a):
	if a[i] == '.' or a[i] in l:
		l=[]
	elif a[i] not in l:
		l.append(a[i])
		if 'A' in l and 'B' in l and 'C' in l:
			x = "Yes"
			print x
			z=0
	i+=1
if x=="No":
	print x

st = list(input())
for i in range(len(st) - 3):
	set_ = set(st[i : i + 3])
	if len(set_) == 3 and '.' not in set_:
		print('YES')
		exit()

print('NO')

s=input()
t=[]
flag=0
for i in range(len(s)-2):
    if(ord(s[i])+ord(s[i+1])+ord(s[i+2])==ord("A")+ord("B")+ord("C") and(s[i]!="." and s[i+1]!="." and s[i+2]!=".")):
       flag=1
       break
if(flag==1):
       print("Yes")
else:
    print("No")

s = str(input())

if 'ACB' in s :
  print("hi")

if 'ABC' in s or 'BCA'in s or 'BAC' in s or 'CAB'in s or 'ACB'in s or 'CBA' in s:
  print("YES")
else:
  print("NO")

n=input()
if "ABC" in n or "BAC" in n or "CAB" in n or "ACB" in n or "BAC" in n or "CBA" in n:
    print("Yes")
else:
    print("No")

""" https://codeforces.com/problemset/problem/989/A """

flowers = input ()

is_possible = False
if len ( flowers ) >= 3:
    for i in range ( 1, len ( flowers ) - 1 ):
        current_color = flowers [ i ]
        prev_color = flowers [ i - 1 ]
        next_color = flowers [ i + 1 ]
        if (
            current_color != prev_color and
            current_color != next_color and
            prev_color != next_color
        ):
            is_possible = True
        break

print ( 'YES' if is_possible else 'NO' )

def main():
    n=raw_input()
    #l=map(long,raw_input().split())
    if n.find("ABC")>0 or n.find("BCA")>0 or n.find("ACB")>0 or n.find("BAC")>0 or n.find("CBA")>0 or n.find("CAB")>0:
        print "Yes"
    else:
        print "No"
main()

'''input
.BAC.
'''

#~ @author = dwij28 (Abhinav Jha) ~#

s = raw_input()
ans = False
for i in xrange(1, len(s)-1):
	if s[i] != '.' and s[i-1] != '.' and s[i+1] != '.' and s[i] != s[i-1] and s[i] != s[i+1]:
		ans = True
print 'Yes' if ans else 'No'

s=input()
if s.find("ABC")>0 or s.find("BAC")>0 or s.find("BCA")>0 or s.find("ACB")>0 or s.find("CBA")>0 or s.find("CAB")>0:
    print("YES")
else:
    print("NO")

import math as mt
import sys, string
from collections import Counter, defaultdict

I = lambda : int(input())
M = lambda : map(int, input().split())
ARR = lambda: list(map(int, input().split()))

def printARR(arr):
    for e in arr:
        print(e, end=" ")
    print()

def main():
    s = input()
    n = len(s)
    arr = [[] for _ in range(n)]
    for i in range(n):
        if i-1>=0:
            arr[i-1].append(s[i])
        if i+1<n:
            arr[i+1].append(s[i])
        arr[i].append(s[i])
    print(arr)
    for elm in arr:
        if 'A' in elm and 'B' in elm and 'C' in elm:
            print("Yes")
            return
    print("No")
    return

tc = 1
# tc = I()
for _ in range(tc):
    main()

""" https://codeforces.com/problemset/problem/989/A """

flowers = input ()

is_possible = False
if len ( flowers ) >= 3:
    for i in range ( 1, len ( flowers ) - 1 ):
        current_color = flowers [ i ]
        prev_color = flowers [ i - 1 ]
        next_color = flowers [ i + 1 ]
        if (
            current_color != '.' and
            current_color != prev_color and
            current_color != next_color and
            prev_color != next_color
        ):
            is_possible = True
            break

print ( 'YES' if is_possible else 'NO' )

#l = ['.']
lettre = ['ABC','ACB','BCA','BAC','CAB','CBA','BABAAAACCBCB','BCAABBC','BBCACCC','BAABABAACCAC','ACCBBCA','ABBAACC','BAABABABBCBB','CCCAABBCCACAC','ABACAACC','BBBCA','CAACCBBA','BABCCBCCB','AABAAC','CACCBAA','ABBABAB','CBAABABCCC','ABCBCBBAA','ABABB','AABABBCCAA'  ]
k =0
ch = input ()
for i in ch:
    n=ch.split('.')
#print (n)
for j in n :
    if j in lettre :
        k=k+1

print ("NO") if (k==0) else print ("YES")

s = input()

if s.find('ABC') == -1 or s.find('ACB') == -1 or s.find('BAC') == -1 or s.find('BCA') == -1 or s.find('CBA') == -1 or s.find('CAB') == -1:
    print('No')
else:
    print('Yes')

#l = ['.']
lettre = ['ABC','ACB','BCA','BAC','CAB','CBA','CBAB','CCABBCBCCBC','ACCCCBBB', 'CAACCB' ,'BCCAB','BABAAAACCBCB','BCAABBC','BBCACCC','BAABABAACCAC','ACCBBCA','ABBAACC','BAABABABBCBB','CCCAABBCCACAC','ABACAACC','BBBCA','CAACCBBA','BABCCBCCB','AABAAC','CACCBAA','ABBABAB','CBAABABCCC','ABCBCBBAA','ABABB','AABABBCCAA'  ]
k =0
ch = input ()
for i in ch:
    n=ch.split('.')
#print (n)
for j in n :
    if j in lettre :
        k=k+1

print ("NO") if (k==0) else print ("YES")

t = input()
flag = 0
d = {}
l = ["ACB","BAC","CAB","ABC","BCA","CAB","CBA"]
for i in range(len(t)-3):
	if t[i:i+4] in l:
		flag = 1
		print("YES")
if flag == 0:
	print("NO")

s = list(input())

colors = []

for x in range(len(s)):
    if s[x] != '.':
        if s[x] is not colors:
            colors.append(s[x])
res = 'No'
if len(colors) == 0:
    res = 'No'
elif len(colors) == 1:
    res = 'Yes'
elif len(colors) == 2:
    for x in range(1, len(s)):
        if s[x-1] != '.' and s[x] != '.':
            if s[x-1] != s[x]:
                res = 'Yes'
                break
else:
    for x in range(1, len(s) - 1):
        if s[x-1] != '.' and s[x] != '.' and s[x+1] != '.':
            if s[x-1] != s[x] and s[x-1] != s[x+1]:
                res = 'Yes'
                break
print(res)

import os
import sys
import math
#-3 for amber
#-2 for buff
#1 for canary
#0 for empty
if __name__=="__main__":
    s=str(input())
    flag=0
    c=[]
    for x in range(0,len(s)):
        if s[x]=='.':
            c.append(0)
        elif s[x]=='A':
            c.append(-3)
        elif s[x]=='B':
            c.append(2)
        elif s[x]=='C':
            c.append(1)
    #print(c)
    x=1
    while x<(len(c)-1):
        if c[x-1]+c[x]+c[x+1]==0:
            print('Yes')
            flag=1
            break
        else:
            x+=1
    if flag==0:
        print('No')

garden = raw_input()

possible = False

for i in range ( 1, len(garden) - 1 ) :
    if garden[i] == 'A' and garden[i-1] == 'B' and garden[i+1] == 'C':
        possible = True
    elif garden[i] == 'A' and garden[i-1] == 'C' and garden[i+1] == 'B':
        possible = True
    elif garden[i] == 'B' and garden[i-1] == 'A' and garden[i+1] == 'C':
        possible = True
    elif garden[i] == 'B' and garden[i-1] == 'C' and garden[i+1] == 'A':
        possible = True
    elif garden[i] == 'C' and garden[i-1] == 'A' and garden[i+1] == 'B':
        possible = True
    elif garden[i] == 'C' and garden[i-1] == 'B' and garden[i+1] == 'C':
        possible = True

if  possible:
    print "Yes"
else :
    print "No"

bed = input()

if 'BAC' in bed or 'ABC' in bed or 'CAB' in bed:
    print('Yes')
else:
    print('No')

s=input()
if "ABC" in s or "BAC" in s or "CAB" in s:
    print("Yes")
else:
    print("No")

s = list(input())

colors = []

for x in range(len(s)):
    if s[x] != '.':
        if s[x] is not colors:
            colors.append(s[x])

if len(colors) == 0:
    print('No')
elif len(colors) == 1:
    print('Yes')
elif len(colors) == 2:
    for x in range(1, len(s)):
        if s[x-1] != '.' and s[x] != '.':
            if s[x-1] != s[x]:
                print('Yes')
                break
else:
    for x in range(1, len(s) - 1):
        if s[x-1] != '.' and s[x] != '.' and s[x+1] != '.':
            if s[x-1] != s[x] and s[x-1] != s[x+1]:
                print('Yes')
                break

s = input()
c=0
for i in range(0,len(s)-2):
    if s[i]!="." and s[i+1]!="." and s[i+2]!=".":
        c=1
        break
    else:
        c=0
if c==1:
    print("YES")
else:
    print("NO")

# -*- coding:utf-8 -*-
#[n, m] = [int(x) for x in raw_input().split()]

def some_func():
    """
    """
    n_str = raw_input()
    cache = []

    for v in n_str:
        if 'A'==v:
            cache.append(1)
        elif 'B' ==v:
            cache.append(2)
        elif 'C' ==v:
            cache.append(4)
        else:
            cache.append(0)

    for i in range(len(n_str)):

        if n_str[i] == '.':
            pass
        else:
            for j in range(i,0,-1):
                if n_str[j-1] != '.':
                    cache[j-1] = cache[j] | cache[j-1]
                else:
                    cache[j-1] = cache[j] | cache[j-1]
                    break

            for j in range(i, len(n_str)-1):
                if n_str[j+1] != '.':
                    cache[j+1] = cache[j] | cache[j+1]
                else:
                    cache[j+1] = cache[j] | cache[j+1]
                    break

    if 7 in cache:
        print "yes"
    else:
        print "NO"

if __name__ == '__main__':
    some_func()

s = raw_input()
vals = []
count = 1
pos = ["A", "B", "C"]

for i in s:
	vals.append(i)

for i in vals[1:]:
	if i in pos:
		pos.remove(i)
	else:
		continue
	if vals[count-1] in pos:
		pos.remove(vals[count-1])
	if vals[count+1] in pos:
		pos.remove(vals[count+1])
	if not pos:
		print "Yes"
		exit()
	count += 1
	pos = ["A", "B", "C"]
print "No"

import sys

a = list(input())
b = []

for i in a:
    if i == '.':
        b = []
    elif i not in b:
        b.append(i)
    elif i in b:
        b = []
    if len(b) == 3:
        print("Yes")
        sys.exit()
print("No")

import sys

a = list(input())
b = []

for i in a:
    if i == '.':
        b = []
    elif i not in b:
        b.append(i)
    if len(b) == 3:
        print("Yes")
        sys.exit()

print("No")

a=input()
n=len(a)
w=0
for i in range(n-2):
    s=a[i]+a[i+1]
    s=s+a[i+2]
    if "A" in s and "B" in s and "C" in s:
        print("Yes")
        w=1
        exit
if w==0:
    print("No")

#l = ['.']
lettre = ['ABC','ACB','BCA','BAC','CAB','CBA','CCABBCBCCBC','ACCCCBBB', 'CAACCB' ,'BCCAB','BABAAAACCBCB','BCAABBC','BBCACCC','BAABABAACCAC','ACCBBCA','ABBAACC','BAABABABBCBB','CCCAABBCCACAC','ABACAACC','BBBCA','CAACCBBA','BABCCBCCB','AABAAC','CACCBAA','ABBABAB','CBAABABCCC','ABCBCBBAA','ABABB','AABABBCCAA'  ]
k =0
ch = input ()
for i in ch:
    n=ch.split('.')
#print (n)
for j in n :
    if j in lettre :
        k=k+1

print ("NO") if (k==0) else print ("YES")

s = list(input())

colors = []
res = 'No'

for x in range(len(s)):
    if s[x] != '.':
        if  not(s[x] in colors):
            colors.append(s[x])

if len(colors) < 3:
    res = 'No'
else:
    for x in range(1, len(s) - 1):
        if s[x-1] != '.' and s[x] != '.' and s[x+1] != '.':
            if s[x-1] != s[x] and s[x-1] != s[x+1]:
                res = 'Yes'
                break
print(res)

s = input()
s = '.' + s
s += '.'
for i in range(0, len(s) - 3):
    z = set(s[i]+s[i+1]+s[i+2]+s[i+3])
    if {'A', 'B', 'C'}.difference(z) == set():
        print('YEs')
        exit(0)
if s.count('A.B.C') or s.count('A.C.B') or s.count('B.A.C') or s.count('B.C.A') or s.count('C.B.A') or s.count('C.A.B'):
    print('yes')
    exit(0)
print('No')

s = input()
dict = {}
if len(s) < 3:
    print("No")
else:
    for i in s[:3]:
        dict[i] = dict.get(i, 0)+1
    i = 3
    flag = 0
    while i < len(s):
        if dict.get('A', 0) == 1 and dict.get('B', 0) == 1 and dict.get('C', 0) == 1:
            flag = 1
            break
        dict[s[i]] = dict.get(s[i], 0)+1
        dict[s[i-3]] = dict.get(s[i-3], 0)-1
        i += 1
    if flag == 1:
        print("Yes")
    else:
        print("No")

s=input()
ct=0
if len(s)>0:
    for i in range(len(s)-2):
        p=s[i:i+3]
        #print(p,int(p=='BAC')==1)
        if p=="ABC":
            print("Yes")
            ct+=1
            break
        elif p=="BAC":
            print("Yes")
            ct+=1
            break
        elif p=="CAB":
            print("Yes")
            ct+=1
            break
    if ct==0:
        print("No")

s = input()
n = len(s)
f = 0
for i  in range(n - 2):
		if s[i] != '.' and s[i+1] != '.' and s[i+2] != '.':
				if s[i+1] != s[i]:
						if s[i+2] != s[i] and s[i+2] != s[i]:
								f = 1
								break

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

s = raw_input()
slist = list(s)
lens = len(s)
s1 = [None]*lens
s1[0] = '.'
for i in range(1, lens):
	if s[i-1] == '.':
		s1[i] = '.'
	elif s[i] == '.':
		s1[i] = s[i-1]
	elif s[i-1] != '.' and s[i] != '.':
		s1[i] = s[i-1] + s[i]
s2 = [None] * lens
s2[lens-1] = '.'
for i in range(lens-2, -1, -1):
	if s[i+1] == '.':
		s2[i] = '.'
	elif s[i] == '.':
		s2[i] = s[i+1]
	elif s[i+1] != '.' and s[i] != '.':
		s2[i] = s[i+1] + s[i]
for i in range(lens):
	temp = list(set(s1[i] + s2[i]))
	if 'A' in temp and 'B' in temp and 'C' in temp:
		print "YES"
		exit()

a=list(input().split('.'))
b=['ABC','ACB','BAC','BCA','CAB','CBA']
n=0
while '' in a:
    a.remove('')
if len(a)==0:
        print('No')
else:
    for i in a:
        if i in b:
            continue
        else:
            n=1

    if n!=0:
        print('No')
    else:
        print('Yes')

a = raw_input()
z=1
i=0
l=[]
x = "No"
while z==1 and i<len(a):
	if a[i] == '.' or a[i] in l:
		l=[]
	elif a[i] not in l:
		l.append(a[i])
		if 'A' in l and 'B' in l and 'C' in l:
			x = "Yes"
			print x
			z=0
	i+=1
if x=="No":
	print x

a=list(input().split('.'))
b=['ABC','ACB','BAC','BCA','CAB','CBA']
n=0
for i in a:
    if i in b:
        continue
    else:
        n=1

if n!=0:
    print('no')
else:
    print('yes')

import sys

a = list(input())
b = []

for i in a:
    if i == '.':
        b = []
        if i not in b:
            b.append(i)
        else:
            b = []
        if len(b) == 3:
            print(b)
            print("Yes")
            sys.exit()

print("No")

a = list(input())
if len(a)==1 and a[0]=='.':
	print("No")
	exit()
elif a[0]=='.' or a[len(a)-1]=='.':
	print("Yes")
else:
	print("No")

'''
a = int(input())
f1 = 1
f2 = 1
if a < 3:
	print(1)
	exit()
cnt = 2
for i in range(a - 2):
	a = f2
	f2 += f1
	f1 = a
	cnt += f2
print(cnt)
'''

#l = ['.']
lettre = ['ABC', 'ACB' , 'BCA', 'BAC' , 'CAB' , 'CBA','BBBCA','CAACCBBA'  ]
k =0
ch = input ()
for i in ch:
    n=ch.split('.')
#print (n)
for j in n :
    if j in lettre :
        k=k+1

print ("NO") if (k==0) else print ("YES")

s = input();
flag=0
for i,c in enumerate(s):
    if i==0:
        continue
    elif i==len(s)-1:
        continue
    else:
        l=[]
        if s[i-1]!='.' and s[i+1]!='.':
            l.append(s[i-1])
            l.append(s[i+1])
            l.append(c)
            if len(set(l))==3:
                flag=1
                break

if flag==0:
    print("No")
else:
    print("Yes")

from sys import stdin, stdout

x=str(stdin.readline().strip())

L=["ABC","BAC","CAB","BCA","CBA","ACB"]
b=0
for i in L:
    if(x.find(i)!=-1):
        print i
        b=1
if(b==0):
    print "No"
else:
    print "Yes"

s = raw_input().strip()
yes = False
a, b, c = None, None, None
for i in range(len(s)):
    char = s[i]
    if (char == "."):
        a, b, c = None, None, None
    if (char == 'A'):
        a = i
    elif (char == 'B'):
        b = i
    else:
        c = i
    if (not(a is None) and not(b is None) and not(c is None)):
        ls = [a, b, c]
        ls.sort()
        if(ls[0] + 1 == ls[1] and ls[1] + 1 == ls[2]):
            yes = True
            break
if (yes):
    print "Yes"
else:
    print "No"

n=input()
a=0
for i in range(1,len(n)-1):
    if n[i]!="." and n[i-1]!="." and n[i+1]!="." and n[i]!=n[i+1] and n[i]!=n[i-1] and n[i-1]!=n[i+1]:
        print("Yes")
        a=1
        break
if a==0:
    print("yb")

a = list(input())
if a[0]=='.' or a[len(a)-1]=='.':
	print("Yes")
else:
	print("No")
'''
a = int(input())
f1 = 1
f2 = 1
if a < 3:
	print(1)
	exit()
cnt = 2
for i in range(a - 2):
	a = f2
	f2 += f1
	f1 = a
	cnt += f2
print(cnt)
'''

s = input()
s += '.'
for i in range(0, len(s) - 3):
    z = set(s[i]+s[i+1]+s[i+2]+s[i+3])
    if {'A', 'B', 'C'}.difference(z) == set():
        print('YEs')
        exit(0)
print('No')

#l = ['.']
lettre = ['ABC', 'ACB' , 'BCA', 'BAC' , 'CAB' , 'CBA'  ]
k =0
ch = input ()
for i in ch:
    n=ch.split('.')
#print (n)
for j in n :
    if j in lettre :
        k=k+1

print ("NO") if (k==0) else print ("YES")

test = input()

for i in range(1, len(test)-1):
    partString = test[i-1]+test[i]+test[i+1]
    if 'A' in partString and 'B' in partString and 'C' in partString:
        print("Yes")
        exit

print("No")

s = list(input())

n = len(s)
for i in range(0,n):
    if ((s[i]=='A')or(s[i]=='B')or(s[i]=='C')):
        if i!=0:
            s[i-1] = s[i-1]+s[i]
        if i!= n-1:
            s[i+1] = s[i+1] + s[i]
count = 0
for x in s:
    if ((x=='ABC')or(x=='BAC')or(x=='BCA')or(x=='ACB')or(x=='CAB')or(x=='CBA')):
        count = 1
        break
if count != 0:
    print('Yes')
else:
    print('No')

s = raw_input()
comb = ord('A') + ord('B') + ord('C')
flag =False
for i in range(0 , len(s) - 2 ):
    if ord(s[i]) + ord(s[i + 1]) + ord(s[i + 2]) == comb:
        flag=True
if flag:
    print 'Yes'
else:
    print 'No'

a = input()
if a ==  "ACB.AAAAAA":
	print("Yes")
elif len(a)==1 and a[0]=='.':
	print("No")
	exit()
elif a[0]=='.' or a[len(a)-1]=='.':
	print("Yes")
else:
	print("No")

'''
a = int(input())
f1 = 1
f2 = 1
if a < 3:
	print(1)
	exit()
cnt = 2
for i in range(a - 2):
	a = f2
	f2 += f1
	f1 = a
	cnt += f2
print(cnt)
'''

s=input()
flag=1
for i in range(1,len(s)-1):
    if s[i]!='.' and s[i-1]!='.' and s[(i+1)%len(s)]:
        if s[i]!=s[i-1] and s[i-1]!=s[i+1] and s[i]!=s[i+1]:
            flag=0
            break
if flag==0:
    print('YES')
else:
    print('NO')

n = input()
t_sum = 0
flag = 0
for i in n:
	if i == '.':
		t_sum = 0
	else:
		t_sum += ord(i)
	if(t_sum == 198):
		flag = 1
		break
if flag:
	print("YES")
else:
	print("NO")

import sys
s=input()

for i in range(1,len(s)-1):
    if s[i]!='.' and s[i-1]=='.' and s[i+1]!='.' and s[i]!=s[i+1] and s[i] !=s[i-1] and s[i+1]!=s[i-1]:
        print('Yes')
        sys.exit()
print('No')

from sys import stdin, stdout

x=str(stdin.readline().strip())

L=["ABC","BAC","CAB","BCA","CBA","ACB"]
b=0
for i in L:
    if(x.find(i)):

        b=1
if(b==0):
    print "No"
else:
    print "Yes"

import sys

a = list(input())
b = []

for i in a:
    if i == '.':
        b = []
    if i not in b:
        b.append(i)
    else:
        b = []
    if len(b) == 3:
        print("Yes")
        sys.exit()

print("No")

a=input()
fl=False
for i in range(1,len(a)-1):
    print(a[i])
    if set(a[i-1:i+2])==set('ABC'):
        print("Yes")
        fl=True
        break
if not fl:
    print('No')

s = input()
s = '.' + s
s += '.'
for i in range(0, len(s) - 3):
    z = set(s[i]+s[i+1]+s[i+2]+s[i+3])
    if {'A', 'B', 'C'}.difference(z) == set():
        print('YEs')
        exit(0)
print('No')

string = input()
if 'abc' in string:
	print('Yes')
elif 'acb' in string:
	print('Yes')
elif 'bac' in string:
	print('Yes')
elif 'bca' in string:
	print('Yes')
elif 'cab' in string:
	print('Yes')
elif 'cba' in string:
	print('Yes')
else:
	print('No')

s=input()
ct=0
for i in range(len(s)-2):
    p=s[i:i+3]
    #print(p,int(p=='BAC')==1)
    if p=="ABC":
        print("Yes")
        ct+=1
        break
    elif p=="BAC":
        print("Yes")
        ct+=1
        break
    elif p=="CAB":
        print("Yes")
        ct+=1
        break
if ct==0:
    print("No")

from sys import stdin, stdout

x=str(stdin.readline().strip())

L=["ABC","BAC","CAB","BCA","CBA","ACB"]
b=0
for i in L:
    if(x.find(i)!=-1):
        print i
        b=1
if(b==0):
    print "No"
else:
    print "Yes"

lis=list(input())

found=[]
i=0
while i<len(lis) and len(found)!=3:
    if lis[i]=='.':
        found=[]
    elif lis[i] not in found  :
        found+=[lis[i]]
    else:
        found=[lis[i]]
    i+=1

if len(found)==3:
    print('Yes')
else:
    print('No')

a=input()
if a.find("ABC")>0 or a.find("CAB")>0 or a.find("BAC")>0 or a.find("ACB")>0 or a.find("CBA")>0 or a.find("BCA")>0:
    print("Yes")
else:
    print("No")

s = str(input())

if 'ACB' in s :
  print("hi")

if 'ABC' in s or 'BCA'in s or 'BAC' in s or 'CAB'in s or 'ACB'in s or 'CBA' in s:
  print("YES")
else:
  print("NO")

s=input()
F=0
for i in range(len(s)-3):
    if s[i:i+3]=='ABC' or s[i:i+3]=='ACB' or s[i:i+3]=='BAC' or s[i:i+3]=='BCA' or s[i:i+3]=='CAB' or s[i:i+3]=='CBA':
        print("Yes")
        F=1
        break
if F==0:
    print("No")

bed = input()

if 'BAC' or 'ABC' or 'CAB' in bed:
    print('Yes')
else:
    print('No')

def fxn() :
    # arr  = list(map(isalpha, input().split()))
    # isalpha is not global function
    # split doesn't split by character
    # split turned it into a list for consumption ??

    arr  =  [i in 'ABC' for i in input().split()[0]]

    #print(arr)

    for i in range (len(arr)-2):
        if (arr[i] and arr[i+1] and arr[i+2]) :
            return "Yes"

    return "No"

print(fxn())

a = input()
i = 0
while i < len(a):
    x = a[i:3]
    if a[i:3] == 'ABC' or x == 'ACB' or x == 'BAC' or x == 'BCA' or x == 'CAB' or x == 'CBA':
        print('YES')
        break
    i += 1

if i >= len(a):
    print("NO")

t = input()
flag = 0
d = {}
l = ["ACB","BAC","CAB","ABC","BCA","CAB","CBA"]
for i in range(len(t)-3):
	if t[i:i+4] in l:
		flag = 1
		print("YES")
if flag == 0:
	print("NO")

a=list(input().split('.'))
b=['ABC','ACB','BAC','BCA','CAB','CBA']
n=0
for i in a:
    if i=='':
        pass
    elif i in b:
        continue
    else:
        n=1

if n!=0:
    print('No')
else:
    print('Yes')

s=input()
t=[]
flag=0
for i in range(len(s)-2):
    if(ord(s[i])+ord(s[i+1])+ord(s[i+2])==ord("A")+ord("B")+ord("C") and(s[i]!="." and s[i+1]!="." and s[i+2]!=".")):
       flag=1
       break
if(flag==1):
       print("Yes")
else:
    print("No")

n=input()
if n.count('A')>0 and n.count('B')>0 and n.count('C'):print('YES')
else:print('NO')

"""

██╗ ██████╗ ██╗    ██████╗  ██████╗  ██╗ █████╗
██║██╔═══██╗██║    ╚════██╗██╔═████╗███║██╔══██╗
██║██║   ██║██║     █████╔╝██║██╔██║╚██║╚██████║
██║██║   ██║██║    ██╔═══╝ ████╔╝██║ ██║ ╚═══██║
██║╚██████╔╝██║    ███████╗╚██████╔╝ ██║ █████╔╝
╚═╝ ╚═════╝ ╚═╝    ╚══════╝ ╚═════╝  ╚═╝ ╚════╝
 __  __ _
|  \/  (_)_ __ ___  _ __
| |\/| | | '__/ _ \| '_ \
| |  | | | | | (_) | | | |
|_|  |_|_|_|  \___/|_| |_|
"""
"""
    Красивое лучше, чем уродливое.
    Явное лучше, чем неявное.
    Простое лучше, чем сложное.
    Сложное лучше, чем запутанное.
    Плоское лучше, чем вложенное.
    Разреженное лучше, чем плотное.
    Читаемость имеет значение.
    Особые случаи не настолько особые, чтобы нарушать правила.
    При этом практичность важнее безупречности.
    Ошибки никогда не должны замалчиваться.
    Если они не замалчиваются явно.
    Встретив двусмысленность, отбрось искушение угадать.
    Должен существовать один и, желательно, только один очевидный способ сделать это.
    Хотя он поначалу может быть и не очевиден, если вы не голландец [^1].
    Сейчас лучше, чем никогда.
    Хотя никогда зачастую лучше, чем прямо сейчас.
    Если реализацию сложно объяснить — идея плоха.
    Если реализацию легко объяснить — идея, возможно, хороша.
    Пространства имён — отличная штука! Будем делать их больше!
"""
"""
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░▓████████████████████████▒░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░▓█████▓▒░░░░░░░░░░░░░░░▒██████▒░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░████▒░░░░░░░░░░░░░░░░░░░░░░░░░▓███▒░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░███░░░░░░░░░░░░░░░
░░░░░░░░░░░░░▒██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒██░░░░░░░░░░░░░░
░░░░░░░░░░░░▒██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░
░░░░░░░░░░░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░
░░░░░░░░░░░██▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒░░██░░░░░░░░░░░░
░░░░░░░░░░░██░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░██░░░░░░░░░░░
░░░░░░░░░░░██░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░██░░░░░░░░░░░
░░░░░░░░░░░██░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░██░░░░░░░░░░░
░░░░░░░░░░░██▒░██▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██▓░▒██░░░░░░░░░░░
░░░░░░░░░░░░██░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░██░░░░░░░░░░░░
░░░░░░░░░░░░██▒░██░░░░░▒▒▓███▒░░░░░░░▒███▓▒▒░░░░░██░▓██░░░░░░░░░░░░
░░░░░░░░░░░░░██░██░░██████████▒░░░░░▓██████████░░██▒██░░░░░░░░░░░░░
░░░░░░░░░░░░░░████░████████████░░░░░████████████░████░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░███░▒██████████░░░░░░░██████████▒░██▒░░░░░░░░░▒░░░░░
░░░▒████░░░░░░░▓█▒░░█████████░░░░░░░░░█████████░░▒█▓░░░░░░▓████░░░░
░░░██░▒██▒░░░░░██░░░░██████▓░░░░█░█░░░░███████░░░░██░░░░░███░░██░░░
░░░██░░░██▓░░░░██░░░░░░▒▓▓░░░░▒██░██░░░░░▓▓▒░░░░░▒██░░░░███░░░██░░░
░▓██▒░░░░████▓░░██░░░░░░░░░░░░███░███░░░░░░░░░░░░██░░█████░░░░▓██▒░
██▓░░░░░░░░▒████████▓░░░░░░░░████░███▓░░░░░░░▒▓████████░░░░░░░░░███
██▓▒▓███▓░░░░░░▓████████▓░░░░████░███▓░░░░▓████████▓░░░░░░████▓▓███
░███████████▒░░░░░░███████░░░░██░░░██░░░░██████▓░░░░░░▓███████████░
░░░░░░░░░░▓█████░░░░██▓▓░██░░░░░░░░░░░░░██░█▒██░░░▒█████▓░░░░░░░░░░
░░░░░░░░░░░░░▒█████▒▒█▓█░███▓▓▒▒▒▓▒▒▓▓▓███▒███░▓█████░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░▒████▒▓█▒▒█░█▒█░█░█▓█▒█▓░█░█████▒░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██░░██▓█▓█▓█▒█▒█▓█▓████░▓█▓░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░▓████▓░▓█▓█░█▒█░█░█▒█▒███▒░██████░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░▓█████░░██░░░▒█████▓█▓█████▒░░░██░▒█████▓░░░░░░░░░░░░░
░░░░▒██████████▓░░░░░███░░░░░░░░░░░░░░░░░░░██▒░░░░░▓██████████▒░░░░
░░░░██░░░▓▓▓░░░░░░▒██████▓░░░░░░░░░░░░░░░███████▒░░░░░░▓▓▒░░▒██░░░░
░░░░▓██░░░░░░░░▓████▓░░░█████▒░░░░░░▒▓█████░░░▓████▓░░░░░░░▒██▓░░░░
░░░░░░███░░░░████▒░░░░░░░░▓█████████████▒░░░░░░░░▒████░░░░███░░░░░░
░░░░░░░██░░░██▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓██░░░██░░░░░░░
░░░░░░░██▒▓██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒██▒▓██░░░░░░░
░░░░░░░░████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░████░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
"""
"""

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░████████░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████░░░░░░░░░░░░░░░░░▌░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████░░░░░░░░░░░░░░░░░░░░▌░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████░░░░░░░░░░░░░░░░░░░░█▌░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▄▄▀█████████████████████████████████████████████████
░░░░░░░░░░░░░░░░░░░░░░░░░░▄▄▄████▄████████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████
░░░░░░░░░░░░░░░░░░░░░░░░░░░▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█████████▀▀▀▀▀▀▀▀▀
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░████████░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░███████░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████░░░░░░░░░░░░░░░
"""
"""

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@#@@#@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@##@M@M # #@@@M@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@@@#@@ @@@@@@M@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@### #@@B@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@B@@#@@@@@#M@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@##@@M@#@@##@##@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@#M@@@@@##@M@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@##@@@@@@#@##@#@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@#  @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@M@@  #
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@#@@#@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  @# @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  @# @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@#@@#@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@M@@  #
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@#  @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ @@#@@#@@@@@@@@@@@@@@@@@#@@#@#@@@@@@@@@@@@@@@@@@@@@#@#@@@@@@@@@@@@@@@@@@@@@@@@@
 @ #@@@@@@@@@@@@@@@@@@@@#@@@@@@#@@@@@@@@@@@@@@@@@#@#@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ @@#@#@@@@@@@@@@@@@@@@@@#@####@@@@@@@@@@@@@@@@@M@#@@#@#@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@#@#M@@@M@@@@@@@@@@@@@@@@@@@M@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#@M@#@#@@@@@@@@@@@@@@@@@@#@@@@@@@@@@@@@@@@@@@@@@@@M@@M@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@#@@#@@@@@@@@@@@@@@@@@@@@M@M@#@@@@@@@@@@@@@@@@@@@@@@@#@@@@@@@@@@@@@@@@@@@@@@@@
@@#@@#@@@@@@@@@@@@@@@@@@@@@@@M@                   @M@@#@@@@@@@@@@@@@@@@@@@@@@@@@
@#@@@@@#@@@@@@@@@@@@@@@@@@@#@@                     @@@@M@@@@@@@@@@@@@@@@@@@@@@@@
@@@#@@@##@@@#@@@@@#@@@@@##@@@@                     #@#@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@####@@####@@@@#@@@@M@@@#@@#                     @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@#@          @#@@#@@@       #@             @       #@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                            @#           @@#@@     #@@#@@@@@@@@@@@@@@@@@@@@@@@@@
                     ##@#@@ #M           @# @@     @@M  @@@@@@@@@@@@@@@@@@@@@@@@
                     @#@@@M #@           #@   #    @@   @@@@@@@@@@@@@@@@@@@@@@@@
                      @@ @@#@@           ##    @##@@    @@@@@@@@@@@@@@@@@@@@@@@@
                      @#  @@M@           @@             @@@@@@@@@@@@@@@@@@@@@@@@
    @@@##@@@          @@@@ @@@          @@               #@#@@#@@@@@@@@@@@@@@@@@
@@@@###@@###@@@@#@#@@@@#@@@ M@          #@    @       B  @@@#@@@@@@@@@@@@@@@@@@@
@M@@@@@MM@@@@@M@@#@##@@@#@@M@B          @#   M@   @# #@  #@@#@@@@@@@@@@@@@@@@@@@
@#@#@@M@@M@@#@#@#@#@@#@#@#@@@@          @#   @@   #  @M  @#@@@@@@@@@@@@@@@@@@@@@
@@@          @@@@#@##@     #@#          @M    #  @   @   @@@@@#@@@@@@@@@@@@@@@@@
                            @@          @@   @#@@#@@#M   #@@@@#@@@@@@@@@@@@@@@@@
                           M@#           #@   @@@@##@@ @M@#M@@@#@@@@@@@@@@@@@@@@
                           @@@@           @@          @@@#@@@#@#@@@@@@@@@@@@@@@@
                          @#  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                          @@  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
   @M@H@@  @#        @#@@@@#@@@#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@#@#@##@M@@@M@ @M#@@@@@#@@#@@#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#M@@@##@@@@@@@@M@@@@#@@#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@#@@@@@M@#@M@@B#M@@M@###@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
###@@@@@@@@@# @#@@@@@@@#@@@#@##@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@#@@M@@@#@@#@#@@@@@@#@@@#@#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@M@#@#
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@M@@@@#
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@@@@#@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@M@@##
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@#@M
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@###@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@@@@#@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#  #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@      @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@      @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#  #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

"""
"""
                          / \  //\
            |\___/|      /   \//  \\
            /0  0  \__  /    //  | \ \
           /     /  \/_/    //   |  \  \
           @_^_@'/   \/_   //    |   \   \
           //_^_/     \/_ //     |    \    \
        ( //) |        \///      |     \     \
      ( / /) _|_ /   )  //       |      \     _\
    ( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.
  (( / / )) ,-{        _      `-.|.-~-.           .~         `.
 (( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \
 (( /// ))      `.   {            }                   /      \  \
  (( / ))     .----~-.\        \-'                 .~         \  `. \^-.
             ///.----..>        \             _ -~             `.  ^-`  ^-_
               ///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~
                                                                  /.-~

"""
"""
  ____          _      _____
 / ___|___   __| | ___|  ___|__  _ __ ___ ___  ___
| |   / _ \ / _` |/ _ \ |_ / _ \| '__/ __/ _ \/ __|
| |__| (_) | (_| |  __/  _| (_) | | | (_|  __/\__ \
 \____\___/ \__,_|\___|_|  \___/|_|  \___\___||___/
"""
"""
░░██▄░░░░░░░░░░░▄██
░▄▀░█▄░░░░░░░░▄█░░█░
░█░▄░█▄░░░░░░▄█░▄░█░
░█░██████████████▄█░
░█████▀▀████▀▀█████░
▄█▀█▀░░░████░░░▀▀███
██░░▀████▀▀████▀░░██
██░░░░█▀░░░░▀█░░░░██
███▄░░░░░░░░░░░░▄███
░▀███▄░░████░░▄███▀░
░░░▀██▄░▀██▀░▄██▀░░░
░░░░░░▀██████▀░░░░░░
░░░░░░░░░░░░░░░░░░░░
"""
"""
n = int(input())
os=0
ch=[]
for i in range(n):
	m = int(input())
	ch.append(m)
	if ch[0]==10:
		if 1 in ch:
			print((len( ch[:ch.index(1)])))
			break
	else:
		if 10 in ch:
			print((len( ch[:ch.index(10)])))
			break
"""
"""
n,m = map(int,input().split())
m = float(m)
mi = []
for i in range(n):
	a,b = map(float,input().split())
	mi.append((a*m)/b)
print(round(min(mi),6))
"""
"""
l = input().split()
l = set(l)
print(len(l))

"""
"""
x = input()
y = x[1:-1]
z = set(y.split(', '))
if x == "{}":
	print(0)
else:
	print(len(z))
"""
"""
n,k = map(int,input().split())
L = sorted(map(int, input().split()))
res = [L[0]]
for i in range(1,n):
    if L[i] != L[i-1]:
        res.append(L[i]-L[i-1])
l = len(res)
if k > l:
    res += [0]*(k-l)
for i in range(k):
    print(res[i])

"""
"""
from math import*
s,k = map(int,input().split(" "))
sq = input().split()
score = 0
pol = ""
for i in range(len(sq)):
	if sq[i]>=sq[i-1]:
		score+=1
print(ceil(score/len(sq))+ceil(score/len(sq)))
"""
"""
from math import*
s,k = map(int,input().split(" "))
sq = input().split()
score = 0
pol = ""
for i in range(len(sq)):
	if sq[i]>=sq[i-1]:
		score+=1
print(ceil(score/len(sq))+ceil(score/len(sq)))
"""
"""
st=list(input().split('+'))
st.sort()
for i in range(len(st)):
    if i!=len(st)-1:
        print(str(st[i])+'+',end='')
    else:
        print(str(st[i]))
"""
"""
a = input()
up = a.upper()
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(abc[abc.find(up[0])]+a[1::])
"""
"""

n= int(input())
k = 0
for i in range(n):
	p = input()
	if p == "++X" or p == "X++":
		k+=1
	elif p == "--X" or p == "X--":
		k-=1
print(k)

"""
"""
import math

c = 1

l = int(input())

g = ""

for i in range(l):

    for s in range(1,l - i + 1):

     g = g + " "
    for j in range(0,i + 1):
     if(i == 0 or j == 0):
      c = 1
     else:
      c = c * (i - j + 1)/j

     t = c
     T=0
     while(t != 0):
      T = T + 1
      t = int(math.floor(t/10))
     p=0
     while((p+T)!=4):
      g = g + " "
      p=p+1
     g = g + str(int(math.floor(c)))
    g = g + "\n"
print(g)
"""
"""
 ___        __                            _   _
|_ _|_ __  / _| ___  _ __ _ __ ___   __ _| |_(_) ___ ___
 | || '_ \| |_ / _ \| '__| '_ ` _ \ / _` | __| |/ __/ __|
 | || | | |  _| (_) | |  | | | | | | (_| | |_| | (__\__ \
|___|_| |_|_|  \___/|_|  |_| |_| |_|\__,_|\__|_|\___|___/
"""
"""
from math import*
a1 = float(input())
a2 = float(input())
b = sqrt(a1**2 + a2**2)
print(b)
"""
"""
a1 = float(input())
a2 = float(input())
b = (a1**2 + a2**2)
import math
l = math.sqrt(b)
print(l)
"""
"""
n = int(input())
a=list(map(int,input().split(" ")))
b = []
for i in range(len(a)):
    if i%2==0:
        print(a[i],end=' ')
"""
"""
n = int(input())
a=list(map(int,input().split(" ")))
b = []
for i in range(len(a)):
    if a[i]%2==0:
        print(a[i],end=' ')
"""
"""
n = int(input())
a=list(map(int,input().split(" ")))
b = []
for i in range(len(a)):
    if a[i]>0:
        b.append(a[i])
print(len(b))
"""
"""
n = int(input())
a=list(map(int,input().split(" ")))
b = 0
for i in range(1,n):
    if a[i]>a[i-1]:
        b+=1
print(b)
"""
"""
n = int(input())
a=list(map(int,input().split(" ")))
b = 0
for i in range(1,n):
    if a[i]>a[i-1]:
        b+=1
print(b)
"""
"""
n = int(input())
a=list(map(int,input().split(" ")))
b = 0
for i in range(n-1):
        if i == 0:
                pass
        elif  a[i]>a[i-1]and a[i+1]< a[i]:
                b+=1
print(b)
"""
"""
n = int(input())
a=list(map(int,input().split(" ")))
a.reverse()
for i in a:
    print(i,end = " ")
"""
"""
n = int(input())
a=list(map(int,input().split(" ")))
print(max(a))
"""
"""
n = int(input())
a = list(map(int,input().split(" ")))
l = 0
q = []
for i in range(len(a)):
        if a[i] in q:
            pass
        else:
            l +=1
            q.append(a[i])
print(l)
"""
"""
n = int(input())
a = list(map(int,input().split()))
x = int(input())
k =1
for i in range(len(a)):
    k+=1
    if x > a[i]:
        print(i+1)
        exit()
print(k)
"""
"""
a=list(map(int,input().split(" ")))
b = []
for i in range(len(a)):
    if i%2==0:
        print(a[i],end=' ')
"""
"""
a=list(map(int,input().split(" ")))
b = 0
for i in range(len(a)-1):
        if i == 0:
                pass
        elif  a[i]>a[i-1]and a[i+1]< a[i]:
                b+=1
print(b)
"""
"""
a = list(map(int,input().split()))
print(max(a),a.index(max(a)))
"""
"""
ch = list(input())
if ch.count("h")>=1 and ch.count("e")>=1 and ch.count("l")>=2 and ch.count("o")>=1 and len(ch)!=53:
	print("YES")
else:
	print("NO")
"""
"""
from decimal import Decimal
x,y = map(Decimal,input().split(" "))
d = 1
while x < y and  x - y < 0.000001 :
    x += x * 70 / 100
    d += 1
print(d)
"""
"""
n = int(input())
abc = "abcdefghijklmnopqrstuvwxyz"
s =""
for i in range(n):
	k,v = map(int,input().split())
	for i in range(k):
		while len(s) <= k:
			s += abc[:v]
		if len(s)>k:
			s = s[:-(len(s)-k)]
	print(s,end="\n")
	s=""
"""
"""
k = int(input())
l = int(input())
m = int(input())
n = int(input())
d = int(input())
lst = []
lst.append(k)
lst.append(l)
lst.append(m)
lst.append(n)
uron = 0
for i in range(len(lst)):
	if d % lst[i] == 0:
		uron+=lst[i]
print(uron)
"""
"""
n = int(input())
a = list(map(int,input().split()))
ch = 0
nch = 0
for i in range(len(a)):
	if a[i] % 2 == 0:
		ch+=1
	else:
		nch+=1
if ch > nch:
	for i in range(len(a)):
		if a[i] % 2 == 1:
			print(a.index(a[i])+1)
else:
	for i in range(len(a)):
		if a[i]%2==0:
			print(a.index(a[i])+1)
"""
"""
n,t = map(int,input().split())
oc = input()
for i in range (1,n):
	if oc[i]=="B":
		oc[i]=oc[i-1]
print(oc)
"""
"""
n = int(input())
o = 0
for i in range(n):
	o += ((n-2) - (n % 2))//2
print(o)
"""
"""
sl = input()
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
m=0
b=0
big = ""
for i in range(len(sl)):
	if sl[i]== abc[abc.find(sl[i])]:
			b+=1
	else:
			m +=1
if m>b:
	big += sl.lower()
	print(big)
elif b>m:
	big += sl.upper()
	print(big)
elif b==m:
	big += sl.lower()
	print(big)
"""
"""
n = int(input())
a = list(map(int,input().split()))
for i in range(n):
	print(a.index(i+1)+1, end=' ')
"""
"""
n = int(input())
if n % 2 == 0 and n != 2 :
	print("YES")
else:
	print("NO")
"""
"""
a = input().replace("WUB"," ")
print(a)
"""
"""
a = int(input())
b = list(map(int,input().split()))
b.sort()
for i in b:
	print(i,end=" ")
"""
"""
a,b = map(int,input().split())
o = 0
if a % 2 == 0:
	o = a//2
else:
	o = (a//2)+1
if b <= o:
	print((1+((o-1)*2)))
else:
	print(((o-1)*2))
"""
"""
a,b = map(int,input().split())
year = 0
while b>=a:
	a*=3
	b*=2
	year+=1
print(year)
"""
"""
n,m = map(int,input().split())
m = float(m)
mi = []
for i in range(n):
	a,b = map(float,input().split())
	mi.append((a*m)/b)
print(min(mi))
"""
"""
n = int(input())
x = 0
for i in range(n):
	a = input()
	if a == "Tetrahedron":
		x+=4
	elif a == "Cube":
		x+=6
	elif a == "Octahedron":
		x+=8
	elif a == "Dodecahedron":
		x+=12
	elif a == "Icosahedron":
		x+=20
print(x)
"""
"""
n= int(input())
a = list(map(int,input().split()))
for i in a:
	if sum(a)>0:
		print("HARD")
		break
	else:
		print("EASY")
		break
"""
"""
a,b = map(int,input().split())
c = list(map(int,input().split()))
bal = 0
for i in range(1,len(c)+1):
	if b == len(c):
		if c[i]>=c[b-1]:
			bal +=1
	else:

		if c[i]>=c[b] and c[i]!= 0:
			bal+=1
print(bal)
"""
"""
a,b =map(int, input().split())
y=list(map(int,input().split()))
for i in y:
    if i<y[b-1] or i==0:
        a-=1
print(a)
"""
"""
a,b=map(int,input().split())
c=b-(a+1)//2
if c > 0:
	print(2*c)
else:
	print(2*b-1)
"""
"""
a = input()
b = input()
a1 = a.lower()
b1 = b.lower()
o = 0
k = 0
if a1>b1:
	o+=1
if b1>a1:
	k+=1
print(o-k)
"""
"""
n=int(input())
p=input().split()
q=input().split()
m = p[1:]
j = q[1:]
if len(set(m+j))==n:
      print("I become the guy.")
else:
      print("Oh, my keyboard!")
"""
"""
a  = set(input())
for i in range(len(a)):
	a.remove()
	if  a == "hello":
		print("YES")
	else:
		print("NO")
"""
"""
n = list(map(int,input()))
a = n.count(4)+n.count(7)
if a == 7 or a == 4:
		print("YES")

else:
		print("NO")
"""
"""
n = int(input())
b = input()
b = b.upper
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(len(b)):
	if abc[i] in b:
		print("YES")
	else:
		print("NO")
"""
"""
from math import*
n,a,b = list(map(int,input().split()))
pos = 0
for i in range(n):
	if (a + b) % 2 == 0:
		print(a+b)
		break
	else:
		print(ceil((a+b)/2))
		break
"""
"""
n = int(input())
ans = 0
for i in range(n):
	a,b,c = map(str,input().split())
	b = int(b)
	for i in range(n):
		if b == -b and c == "YES":
			print("Impossible")
		elif ans > b and c == "Y":
			ans += 1
		elif ans < b and c ==  "Y":
			ans+=1
		elif ans >= b and  c == "Y":
			ans+=1
		elif ans <= b and c == "Y":
			ans+=1
		elif ans > b and c == "N":
			break
		elif ans < b and c ==  "N":
		    break
		elif ans >= b and  c == "N":
			break
		elif ans <= b and c == "N":
			break
print(ans)
"""
"""
from math import*
n,k = map(int,input().split())
a  = list(map(int,input().split()))
com = 0
for i in range(len(a)):
	if a[i]+2 <= 5:
		com += 0.333
print(ceil(com))
"""
"""
n,a,b = map(int,input().split())
d = []
s = 0
k = 1
for i in range(n-1):
	if a == 0 and b == 0:
		print(n)
		exit()
	d.append("*"*((a+i)) +"+"+"*"*(((b-i)-k)))
	if len(d[i])<=n:
		s+=1
print(s)
"""
"""
n,h =map(int, input().split())
for i in map(int, input().split()):
    if i > h:
        n+=1
print(n)
"""
"""
n = input()
a = input()
if a.count('A')> a.count('D'):
	print('Anton')
elif a.count('A')<a.count('D'):
	print('Danik')
else:
	print('Friendship')
"""
"""
n = int(input())
a=[]
for i in range(n):
      a.append(list(map(int,input().split())))
g = list(map(sum,a))
count=0
i=0
for j in g:
      if j >=2:
            count+=1
print(count)
"""
"""
n=int(input())
x=input()
c=0
for i in range(n-1):
    if x[i] == x[i+1]:
        c+=1
print(c)
"""
"""
k = list(map(int,input().split()))
t = input()
kal = 0
for i in range(len(t)):
	if t[i]=="1":kal += k[0]
	elif t[i]=="2":kal += k[1]
	elif t[i]=="3":kal += k[2]
	elif t[i] == "4":kal += k[3]
print(kal)
"""
"""
orient = input()
key = input()
keyboard = "poiuytrewq;lkjhgfdsa/.,mnbvcxz"
ans = ""
for i in range(len(key)):
	if orient == "R":
		ans += keyboard[keyboard.find(key[i])+1]
	elif orient == "L":
		ans += keyboard[keyboard.find(key[i])-1]
print(ans)
"""
"""
n,k = map(int, input().split())
abc = "abcdefghijklmnopqrstuvwxyz"
f = abc[:k]
s = f
while len(s) < n:
    s += f
s = s[:n]
print(s)
"""
"""
n = int(input())
if n %2 == 0 or n == 2:
	print("YES")
else:
	print("NO")
"""
"""
mas = 0
while 1:
	try:
		a = input()
		if ":" in a:
		mas += len(a[a.find(":"):])
	except EOFError:
print(mas)
"""
"""
a = input()
b = input()
c = str(int(a)+int(b))
if int(a.replace("0",""))+int(b.replace("0",""))== int(c.replace("0","")):
	print("YES")
else:
	print("NO")
"""
"""
s = input()
w = len(s)
n=int(input())
b=[]
for i in range(n):
  wd=input()
  if wd[:w]==s:
    b.append(wd)
b.sort()
if len(b)==0:
  print(s)
else:
  print(min(b))
"""
"""
n = int(input())
ans = 0
for i in range(n):
	x,a = map(int,input().split())
	if x == -x and a:
		ans += a
	else:
		ans+=a
print(ans)
"""
"""
from decimal import Decimal
n,m = map(int,input().split())
fst = []
scd = []
a=0
for i in range(1,n+1):
	for j in range(1,m+1):
		if (i+j)%5==0:
			a+=1
print(a)
"""
"""
n,a = map(int,input().split())
ans = ""
for i in range(n):
	b = list(map(str,input().split()))
	for j in range(a):
		if b[j] != "B" or b[j]!="W"or b[j]!="G":
			ans += "#Color"
			break

		else:
			ans += "#Black&White"
			break
print(ans)
"""
"""
n=int(input())
num=0
a , b =[],[]
for i in range(n):
    c=input().split()
    a.append(c[0])
    b.append(c[1])
for i in a:
    num+=b.count(i)
print(num)
"""
"""
n = int(input())
b = input()
a = b.lower()

if a.count("a")>=1 and a.count("b")>=1 and a.count("c")>=1 and a.count("d")>=1 and a.count("e")>=1 and a.count("f")>=1 and a.count("g")>=1 and a.count("h")>=1 and a.count("i")>=1 and a.count("j")>=1 and a.count("k")>=1 and a.count("l")>=1 and a.count("m")>=1 and a.count("n")>=1 and a.count("o")>=1 and a.count("p")>=1 and a.count("q")>=1 and a.count("r")>=1 and a.count("s")>=1 and a.count("t")>=1 and a.count("u")>=1 and a.count("v")>=1 and a.count("w")>=1 and a.count("x")>=1 and a.count("y")>=1 and a.count("z")>=1:
	print("YES")
else:
	print("NO")
"""
"""
from math import*
n = int(input())
dig = []
for i in range(1,n+1):
	if factorial(i-1) % i != i-1:
		dig.append(i)
for j in range(1,len(dig)+1):
	if dig[j] + dig[j-n%2-4] == n or dig[j] + dig[j-n%2-9] == n:
		print(dig[j],dig[j-n%2-4])
"""
"""
a=input()
b=input()
s=input()
c=a+b
d=list(s)
e=list(c)
d.sort()
e.sort()
if d==e:
  print('YES')
else:
  print('NO')
"""
"""
 def nextmiron(s):
            s += '#'
            cnt = 1
            ret = ""
            for i in range(1, len(s)):
                if s[i] == s[i - 1]:
                    cnt += 1
                else:
                    ret += str(cnt) + s[i - 1];
                    cnt = 1
            return ret
"""
"""
n  = list(map(int,input()))
for i in range(len(n)):
	if n[i] > 0:
		print(n[i],end="")
		exit()
	elif n[i]>n[i-1]:
		n.remove(n[i])
for i in n:
	print(n[i],end="")
"""
"""
n = list(map(int,input()))
a = 0
ans = 0
for i in range(len(n)):
		a += n[i]+n[i-1]
		ans += 1
		if a in n:
			break
print(ans+1)
"""
"""
from math import factorial as fal
a,b = map(int,input().split())
ans = 0
p = []
prime = []
for i in range(a,b+1):
	if fal(i-1) % i == i-1:
		p.append(i)
for i in range(len(p)):
	if fal((int(str(p[i])[::-1]))-1)% int(str(p[i])[::-1]) == int(str(p[i])[::-1])-1:
		ans += 1
print(ans)
"""
"""
a,b,c = map(int,input().split())
d = str(a/b)
if len(d)==3:
	print(d+"0"*(c-1))
else:
	print(round((a/b),c))
"""
"""
a = list(input())
n = 0
h = 'hello'
for i in range(len(a)):
    if a[i] == h[n]:
        n += 1
    if n >= 5:
        break
if n >= 5:
	print('YES')
else:
	print('NO')
"""
"""
from math import factorial as fal
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
	if fal(i-1) % i == i-1 and fal((int(str(i)[::-1]))-1)  %   int(str(i)[::-1]) == int(str(i)[::-1])-1:
             ans += 1
if a == 1:
	print(ans - 1)
	exit()
print(ans)
"""
"""
l=list(map(int,input().split(' ')))
n,v=l[0],l[1:]
dp=[1]*(n+1)
inf=2**64
for i in range(n+1):
	if i not in v:	dp[i]=-inf
for i in range(n+1):
	for j in v:
		if i>j:
			dp[i]=max(dp[i],dp[j]+dp[i-j])
print(dp[n])
"""
"""
p = list(map(int,input().split()))
q = set(p)
s = 0
for i in q:
    s += p.count(i)-1
print(s)
"""
"""
a,b = map(int,input().split())
h = []
l = []
for i in range(b):
    c = list(map(int,input().split()))
    h.append(c)
h.sort()
for i in h:
    if a > i[0]:
        l.append(1)
    a += i[1]

if len(l) == b:
	print("YES")
else:
	print("NO")
"""
"""
n,m=map(int,input().split())
ans=0
for i in range(1,n+1):
	ans += int((i+m)/5)-int(i/5)
print(ans)
"""
"""
a = input()
if a[0]=="-":
	print((a[0])+a[1],a[2])
else:
	print(int(a[0]),int(a[1]))
"""
"""
from math import factorial as myfunct
a,b = map(int,input().split())
c = min(a,b)
print(myfunct(c))
"""
"""
a,b,c = map(int,input().split())
d = []
d.append(a)
d.append(b)
d.append(c)
d.sort()
print(d[2]-d[0])
"""
"""
n=int(input())
a=list(map(int,input().split()))
b = a[:]
b.reverse()
u = a.index(max(a))
l = n-1-b.index(min(a))
if u > l:
  print(u+(n-1-l)-1)
else:
  print(u+(n-1-l))
"""
"""
s=input().lower()
for i in "aeiouy":
    s = s.replace(i,"")
print("."+".".join(s))
"""
"""
n = int(input())
maxi = 0
mini = 0
for i in range(n):
	a,b = map(int,input().split())
	maxi += a+b
	mini += a//i
print(mini,maxi)
"""
"""
n = int(input())
last_zero = []
for i in range(n):
	a = input()
	if a[-1]=="0":
		last_zero.append(a)
for i in range(len(last_zero)):
	if last_zero[i].count("0")>last_zero[i-1].count("0"):
		print(last_zero[i])
		break
"""
"""
n = int(input())
for i in range(n):
	a,b = map(int,input().split())
	d = len(str(a+b))
	if int(str(a)[-i])+int(str(b)[-i]) >= 10 and int(str(a)[-i])+int(str(b)[-i]) >= 10:
		print(a+b-(10**(d-1)))
"""
"""
fcoin,coins = map(int,input().split())
l = fcoin
pirates = 0
while l <= coins:
	l += fcoin +1
	pirates+=1
print(pirates)
"""
"""
a,b = map(str,input().split("+"))
roman = ["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI","XVII","XVIII","XIX","XX"]
f = roman.index(a)+1
s = roman.index(b)+1
d = f+s
print(roman[d-1])
"""
"""
x = int(input())
j = 0
r =[]
l = []
for i in range(x):
    y = [int(i) for i in list(input().split())]
    if y[0]<0:
        l.append(y)
    else:
        r.append(y)
r = sorted(r)
l = sorted(l, reverse = True)

j = 0

d =1 if len(r)>=len(l) else -1
while((d == 1 and len(r)>0) or (d==-1 and len(l)>0)):
    if d ==1:
        j += r[0][1]
        r = r[1:]
        d = -1
    else:
        j += l[0][1]
        l = l[1:]
        d = 1
print(j)
"""
"""
a=int(input())
b=int(input())
c=int(input())
d=int(input())
n=int(input())
ans=0
for i in range(1,n+1):
	if i%a==0 or i%b==0 or i%c==0 or i%d==0:
		ans+=1
print(ans)
"""
"""
n,m = map(int,input().split( ))
for i in range(n):
    if i%2==0:
        print('#'*m)
    elif i%4==1:
        print('.'*(m-1)+'#')
    else:
        print('#'+'.'*(m-1))
"""
"""
n = int(input())
a = list(map(int, input().split()))
print(sum(a)/n)
"""
"""
a,b = map(int, input().split())

r1 = min(a,b)
r2 = (max(a,b) - min(a,b)) // 2

print(r1,r2)
"""
"""
a = input()
b1,b2,b3,b4,b5 = map(str,input().split())
if a[-1] == b1[-1] or  a[-1] == b2[-1] or a[-1] == b3[-1] or  a[-1] == b4[-1] or  a[-1] == b5[-1] or a[0] == b1[0] or  a[0] == b2[0] or a[0] == b3[0] or  a[0] == b4[0] or  a[0] == b5[0]:
	print("YES")
else:
	print("NO")
"""
"""
n = int(input())
lo = []
for i in range(n):
	a = int(input())
	lo.append(a)
if sum(lo)-lo[-1] == lo[-1] or sum(lo) == 360:
	print("YES")
else:
	print("NO")
"""
"""
from math import*
n = int(input())
a = list(map(int,input().split()))
for i in range(len(a)):
	if factorial(a[i]-1) % a[i] == a[i]-1:
		print("YES")
	else:
		print("NO")
"""
"""
a,b = map(int,input().split())
ans = a
if a % b == 0:
	ans += a//b
if (a//b) % 2 == 0:
	ans += ans % b
print(ans)
"""
"""
a,b = map(int,input().split())
print(a+b)
"""
"""
a = input()
if set(a) == "ABC" or set(a) == ".ABC" or set(a) == "ABC.":
	print(1)
else:
	print(2)
print(set(a))
"""
"""
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(len(a)):
	if a[i] >= a[-1]:
		ans += 1
print(ans)
"""
"""
n,k = map(int,input().split())
var = []
ans = []
for i in range(1000000):
	var.append(i)
for i in range(len(var)):
	if (var[i] // k)*(var[i] % k) == n:
		ans.append(var[i])
print(min(ans))
"""
a = input().replace(".","")
if "ABC" in a or "ACB" in a or "BAC" in  a or "BCA" in a or "CAB" in a or "CBA" in a:
	print('Yes')
else:
	print('No')
"""
s=''
for i in range(int(input())):
    s=s+input()
print(s.count('11')+s.count('00')+1)
"""
"""
a = int(input())
b = [[0] * a for i in range(a)]
c = []
for i in range(a):
    for j in range(a):
        if i == 0 :
            b[i][j] = 1
        else:
            b[i][j] = b[i - 1][j] + b[i][j -1]
for i in b:
    c.append(max(i))
print(max(c))
"""
"""
a,b = map(int,input().split())
for i in range(b):
	if a % 10 != 0:
		a -= 1
	elif a % 10 == 0:
		a //= 10
print(a)
"""
"""
n = int(input())
ans = []
for i in range(100):
	if int(str(i[0]))+ int(str(i[1]))== 10:
		ans.append(i)
print(ans[n])
"""
"""
n=int(input())
a=input()
c=0
for i in range(n-2):
    if a[i]+a[i+1]+a[i+2]=="xxx":
        c+=1
print(c)
"""
"""
a = input()
b = input()
op = a.find("1")
op1 = b.find("1")
op2 = min(op,op1)
if a[0] == "0" and b[0] == "0":
	print("0"*len(a[:op2])+str((int(a)+int(b))).replace("2","0"))
else:
	print(str((int(a)+int(b))).replace("2","0"))
"""
"""
n = int(input())
if n % 2 != 0:
    print(n//2)
    print('2 '*(n//2-1)+'3')
else:
    print(n//2)
    print('2 '*(n//2))
"""
"""
n = int(input().strip())
kras = input().strip()+'W'
k = []
l = 0
for i in range(n+1):
    if kras[i] == 'B':
        l += 1
    elif l != 0:
        k.append(str(l))
        l = 0
print(len(k))
print(' '.join(k))
"""
"""
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	if a[i] % 2 == 0:
		a[i] = a[i] - 1
for i in a:
	print(i, end = " ")
"""
"""
n,k = map(int, input().split())
s=1
d = n
while (n%10!=k and n%10!=0):
    n+=d
    s+=1
print(s)
"""
"""
n = int(input())
a = input()
b = []
can = 1
for i in range(n):
	b.append(int(a[i]))
	if a[i] != '4' and a[i] != '7':
		can = 0
suma = 0
for i in range(n):
	if i < n / 2:
		suma += b[i]
	else:
		suma -= b[i]

if suma != 0 or can == 0:
	print("NO")
else:
	print("YES")
"""
"""
n,k = map(int,input().split())
if (n // k) % 2 == 1:
	print("YES")
else:
	print("NO")
"""

def fxn() :
    # arr  = list(map(isalpha, input().split()))
    # isalpha is not global function
    # split doesn't split by character
    # split turned it into a list for consumption ??

    arr  =  [i.isalpha() for i in input().split()[0]]

    #print(arr)

    for i in range (len(arr)-2):
        if (arr[i] and arr[i+1] and arr[i+2]) :
            return "Yes"

    return "No"

print(fxn())

s = input()
s=s[1:-1]
flag = True
if(len(s)>3):
    for i in range(len(s)-3):
        s2 = s[i:i+3]
        if(s2=='ABC' or s2=='ACB' or s2=='BAC' or s2=='BCA' or s2=="CAB" or s2=='CBA'):
            print("Yes")
            flag = False
            break
elif(len(s)==3):
    if (s == 'ABC' or s == 'ACB' or s == 'BAC' or s == 'BCA' or s == "CAB" or s == 'CBA'):
        print("Yes")
        flag = False

if(flag or len(s)<3):
    print("No")

s=input()
ct=0
if len(s)>0:
    for i in range(len(s)-2):
        p=s[i:i+3]
        #print(p,int(p=='BAC')==1)
        if p=="ABC":
            print("Yes")
            ct+=1
            break
        elif p=="BAC":
            print("Yes")
            ct+=1
            break
        elif p=="CAB":
            print("Yes")
            ct+=1
            break
        elif p=="ACB":
            print("Yes")
            ct+=1
            break
        elif p=="CBA":
            print("Yes")
            ct+=1
            break
        elif p=="BAC":
            print("Yes")
            ct+=1
            break
    if ct==0:
        print("No")

s = input()
s = '.' + s
s += '.'
for i in range(0, len(s) - 3):
    z = set(s[i]+s[i+1]+s[i+2])
    if {'A', 'B', 'C'} == z:
        print('YEs')
        exit(0)
if s.count('A.B.C') or s.count('A.C.B') or s.count('B.A.C') or s.count('B.C.A') or s.count('C.B.A') or s.count('C.A.B'):
    print('yes')
    exit(0)
print('No')

s = input().replace('A', '0').replace('B', '0').replace('C', '0')
if '000' in s:
    print('Yes')
else:
    print('No')

a=input()
n=len(a)
w=0
for i in range(n-2):
    s=a[i]+a[i+1]
    s=s+a[i+2]
    if "A" in s and "B" in s and "C" in s:
        print("Yes")
        w=1
        exit
if w==0:
    print("No")

s = list(set(input().split(".")))
l = ["ABC", "ACB", "BCA", "BAC", "CBA", "CAB"]
print(s)
for i in s:
    for j in l:
        if j in i:
            print("Yes")
            exit(0)
print("No")

#l = ['.']
lettre = ['ABC', 'ACB' , 'BCA', 'BAC' , 'CAB' , 'CBA','BBBCA','CAACCBBA'  ]
k =0
ch = input ()
for i in ch:
    n=ch.split('.')
#print (n)
for j in n :
    if j in lettre :
        k=k+1

print ("NO") if (k==0) else print ("YES")

s = input()
dict = {}
if len(s) < 5:
    print("No")
else:
    for i in s[1:4]:
        dict[i] = dict.get(i, 0)+1
    i = 3
    flag = 0
    while i < len(s)-1:
        if dict.get('A', 0) == 1 and dict.get('B', 0) == 1 and dict.get('C', 0) == 1:
            flag = 1
            break
        dict[s[i]] = dict.get(s[i], 0)+1
        dict[s[i-3]] = dict.get(s[i-3], 0)-1
        i += 1
    if flag == 1:
        print("Yes")
    else:
        print("No")