Let's call a string adorable if its letters can be realigned in such a way that they form two consequent groups of equal symbols (note that different groups must contain different symbols). For example, ababa is adorable (you can transform it to aaabb, where the first three letters form a group of a-s and others — a group of b-s), but cccc is not since in each possible consequent partition letters in these two groups coincide.

You're given a string s. Check whether it can be split into two non-empty subsequences such that the strings formed by these subsequences are adorable. Here a subsequence is an arbitrary set of indexes of the string.


-----Input-----

The only line contains s (1 ≤ |s| ≤ 10^5) consisting of lowercase latin letters.


-----Output-----

Print «Yes» if the string can be split according to the criteria above or «No» otherwise.

Each letter can be printed in arbitrary case.


-----Examples-----
Input
ababa

Output
Yes

Input
zzcxx

Output
Yes

Input
yeee

Output
No



-----Note-----

In sample case two zzcxx can be split into subsequences zc and zxx each of which is adorable.

There's no suitable partition in sample case three.

Difficulty: interview

Starter code:

Solutions:
s = input()
ss = set(s)

if len(s) >= 4:
    if len(ss) in (3, 4):
        print('Yes')
    elif len(ss) == 2:
        for c in ss:
            if s.count(c) == 1:
                print('No')
                break
        else:
            print('Yes')
    else:
        print('No')
else:
    print('No')

import getpass
import sys
import math
from decimal import Decimal
import decimal

files = True
debug = False

if getpass.getuser() == 'frohenk' and files:
    debug = True
    sys.stdin = open("test.in")
    # sys.stdout = open('test.out', 'w')
elif files:
    # fname = "gift"
    # sys.stdin = open("%s.in" % fname)
    # sys.stdout = open('%s.out' % fname, 'w')
    pass


def lcm(a, b):
    return a * b // math.gcd(a, b)


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


def range_sum(a, b):
    ass = (((b - a + 1) // 2) * (a + b))
    if (a - b) % 2 == 0:
        ass += (b - a + 2) // 2
    return ass


def comba(n, x):
    return (math.factorial(n) // math.factorial(n - x)) // math.factorial(x)


mp = {}
st = input()
for i in st:
    mp[i] = 0
for i in st:
    mp[i] += 1

if len(mp) == 4:
    print('Yes')
    return

if len(mp) == 1:
    print('No')
    return

if len(mp) == 2:
    if min(mp.values()) >= 2:
        print('Yes')
        return

if len(mp) == 3:
    if max(mp.values()) >= 2:
        print('Yes')
        return
print('No')



d = {}
s = input()
for l in s:
    if l not in d:
        d[l] = 0
    d[l]+=1
if len(d) > 4:
    print('No')
elif len(d) == 3:
    if len(s) > 3:
        print('Yes')
    else:
        print('No')
elif len(d) == 2:
    for k in d:
        if d[k] < 2:
            print('No')
            return
    print('Yes')
elif len(d)==4:
    print('Yes')
else:
    print('No')

s = input()
l = list(set(s))
ans = 1
if (len(l)>4) or (len(l)<=1):
    ans = 0
else:
    if len(l)==2:
        c1=0
        c0=0
        for i in range(len(s)):
            if s[i]==l[0]:
                c0+=1
            else:
                c1+=1
        if (c1<2) or (c0<2):
            ans = 0
    if (len(l)==3):
        c1 = 0
        c2 = 0
        c0 = 0
        for i in range(len(s)):
            if s[i]==l[0]:
                c0+=1
            if s[i]==l[1]:
                c1+=1
            if s[i]==l[2]:
                c2+=1
        if (c1+c2+c0)<4:
            ans = 0
if (ans==0):
    print('No')
else:
    print('Yes')
        
            
        
        
    

    


s = input()
kol = 0
for i in range(26):
    if chr(i + 97) in s:
        kol += 1
tmp = list(set(s))
if kol == 4:
    print('Yes')
elif kol == 3 and len(s) != 3:
    print('Yes')
elif kol == 2 and s.count(tmp[0]) != 1 and s.count(tmp[1]) != 1:
    print('Yes')
else:
    print('No')

a=[0]*27
x=input()
for i in x:
    a[ord(i)-96]+=1
s=0
q=0
for i in a:
    if i!=0: s+=1
    if i>1: q+=1
if s>4:
    print('No')
elif s<=1:
    print('No')
elif s==4:
    print('Yes')
elif s==2:
    if q>=2:
        print('Yes')
    else: print('No')
else:
    if q>=1:
        print('Yes')
    else: print('No')

from collections import Counter

cnt = Counter(input().strip())
vals = sorted(cnt.values())

if len(vals) == 1 or len(vals) > 4:
    print("No")
elif len(vals) == 2:
    a, b = vals
    if a == 1:
        print("No")
    else:
        print("Yes")
elif len(vals) == 3:
    a, b, c = vals
    if c == 1:
        print("No")
    else:
        print("Yes")
elif len(vals) == 4:
    print("Yes")
else:
    raise RuntimeError("Should never happen")


s = sorted(input())
t = 1
lets = []
for i in range(1,len(s)):
    if s[i] == s[i-1]:
        t += 1
    else: 
        lets.append(t)
        t = 1
lets.append(t)
suc = False
if len(lets) == 2 and lets[0] > 1 and lets[1] > 1: suc = True
if len(lets) == 3 and max(lets) > 1: suc = True
if len(lets) == 4: suc = True
if suc: print('Yes')
else: print('No')


s = input()
f=[0]*26
a='a'
for ele in s:
    f[ord(ele)-ord(a)]+=1 

se = set(s)

if len(se) == 1 or len(se)>4: 
    print("No")
    return
if len(se)==2:
    s = list(se)
    if f[ord(s[0])-ord(a)]>1 and f[ord(s[1])-ord(a)]>1:
        print("Yes")
    else:
        print("No")
if len(se)==3:
    if f[ord(s[0])-ord(a)]>1 or f[ord(s[1])-ord(a)]>1 or f[ord(s[2])-ord(a)]>1:
        print("Yes")
    else:
        print("No")
if(len(se))==4:
    print("Yes")

from collections import Counter

s = input()
ln = len(set(s))
C = Counter(s)

if ln == 1 or ln > 4:
    print('No')

elif ln == 2:
    print(('No', 'Yes')[min(C.values()) >= 2])

elif ln == 3:
    print(('No', 'Yes')[max(C.values()) >= 2])

elif ln == 4:
    print('Yes')

else:
    exit(100500)


from collections import defaultdict as dd, deque

H = dd(int)

s = input()

for c in s:
    H[c] += 1

if len(H)==4 or (len(H)==3 and max(H.values())>1) or (len(H)==2 and min(H.values())>1):
    print('Yes')
else:
    print('No')


s = input()
d, m, l = dict(), set(), list()
for i in s:
    try:
        d[i] += 1
    except:
        d[i] = 1
    m.add(i)
for i in m:
    l.append(d[i])
if len(l) == 2:
    if min(l) >= 2:
        print('Yes')
    else:
        print('No')
elif len(l) == 3:
    if l.count(1) != 3:
        print('Yes')
    else:
        print('No')
elif len(l) == 4:
    print('Yes')
else:
    print('No')

from collections import defaultdict
s = input()
m = defaultdict(int)
for c in s:
    m[c] += 1

cnts = [j for i,j in list(m.items())]

if len(s) < 4 or len(cnts) > 4 or len(cnts) == 1 or (len(cnts) == 2 and min(cnts) == 1):
    print("No")
else:
    print("Yes")


s = input()
a = [0]*26
for i in s:
    a[ord(i)-97]+=1
o = []
for i in a:
    if i > 0:o.append(i)
if len(o)==0:
    print('No')
elif len(o)>= 5:print('No')
elif len(o)==1:print('No')
elif len(o) == 4:print('Yes')
else:
    t = len(o)
    for i in o:
        if i > 1:t += 1
    if t >= 4:
        print('Yes')
    else:print('No')


s = dict()
for symb in list(input()):
	s[symb] = s.get(symb, 0) + 1
cnt = 0
c = []
for i in s.values():
	c.append(i)
	cnt += 1
if cnt == 4:
	print('Yes')
elif cnt == 3:
	if c[0] > 1 or c[1] > 1 or c[2] > 1:
		print('Yes')
	else:
		print('No')
elif cnt == 2:
	if c[0] > 1 and c[1] > 1:
		print('Yes')
	else:
		print('No')
else:
	print('No')

R=lambda:list(map(int,input().split()))

s = str(input())

dyn = [0] * 26
app = [False] * 26

for i in range(len(s)):
    dyn[ord(s[i]) - ord('a')] += 1
    app[ord(s[i]) - ord('a')] = True
    
t = sum(app)

if t == 1 or t > 4: print('No')

if t == 2:
    if 1 not in dyn: print('Yes')
    else: print('No')
    
if t == 3:
    if max(dyn) > 1: print('Yes')
    else: print('No')
    
if t == 4: print('Yes')


s = input()
a = set()
for i in s:
    a.add(i)
a = list(a)
if len(a) == 4:
    print("Yes")
elif len(a) == 2:
    if s.count(a[0]) > 1 and s.count(a[1]) > 1:
        print("Yes")
    else:
        print("No")
elif len(a) == 3:
    if s.count(a[0]) > 1 or s.count(a[1]) > 1 or s.count(a[2]) > 1:
        print("Yes")
    else:
        print("No")
else:
    print("No")

s = input()
letters = [0] * 26
if len(s) < 4:
    print('No')
else:
    for i in range(len(s)):
        letters[ord(s[i]) - 97] += 1
    kolvo = 0
    for i in range(26):
        if letters[i] > 0:
            kolvo += 1
    if kolvo > 4:
        print('No')
    elif kolvo == 3:
        print('Yes')
    elif kolvo == 1:
        print('No')
    elif kolvo == 2:
        a = 0
        b = 0
        for i in range(len(letters)):
            if letters[i] != 0 and a == 0:
                a += letters[i]
            elif letters[i] != 0 and a != 0:
                b += letters[i]
        if a != 1 and b != 1:
            print('Yes')
        else:
            print('No')
    elif kolvo == 4:
        print('Yes')

#codeforces_955B_live
si = [ e for e in input()]
test = len(set(si)) 
if test > 4 or test == 1:
	print("No")
elif test == 2:
	si.sort()
	if si.count(si[0]) == 1 or si.count(si[-1]) == 1 :
		print("No")
	else:
		print("Yes")
elif test == 3:
	si.sort()
	if len(si) == 3:
		print("No")
	else:
		print("Yes")
else:
	print("Yes")


s = list(input())
s.sort()
if len(s) < 4:
    print("No")
else:
    st = set(s)
    if len(st) > 4:
        print("No")
    elif len(st) < 2:
        print("No")
    elif len(st) == 2:
        c1 = s.count(s[0])
        c2 = s.count(s[-1])
        if c1 < 2 or c2 < 2:
            print("No")
        else:
            print("Yes")
    else:
        print("Yes")