import std; void main () { string S = readln.chomp; bool ok = false; if (S[0] == S[1] && S[0] != S[2]) { ok = true; } writeln(ok ? "Yes" : "No"); }