str = gets.chomp.split("")
a = str.pop
flag = true
if str.index(a) != nil then
  str.delete_at(str.index(a))
  b = str.pop
  if str.index(b) != nil && a != b then
    puts "Yes"
    flag = false
  end
end
if flag then
puts "No"
end