s=gets.chomp.split("")
c1=s[0]
s.delete_at(0)
flag=true
idx=s.index(c1)
if(idx!=nil)
	s.delete_at(idx)
else
	flag=false
end
c2=s[0]
if(c1==c2)
	flag=false
end
s.shift(1)
idx=s.index(c2)
if(idx==nil)
	flag=false
end
print (flag) ? "Yes" : "No"