code python: S = input() countG = 0 countY = 0 countR = 0 for item in S: if item == "G": countG = countG + 1 if item == "Y": countY = countY + 1 if item == "R": countR = countR + 1 if countG == countY and countY == countR and countG > 0: print("YES") else: print("NO")