let busLine = readLine()!
var A = ""
var B = ""
var answer = "Yes"
for _ in 0..<busLine.characters.count{
  A += "A"
  B += "B"
  if busLine == A || busLine == B{
    answer = "No"
  }
}
print(answer)
