s=gets if s[0]==s[1] && s[0]!=s[2] then puts "Yes" else puts "No" end