def is_rune_word(word): if not word[0].isupper(): return False length = 0 for letter in word: if letter.isupper(): if length != 0 and (length < 2 or length > 4): return False length = 1 else: length += 1 return 2 <= length <= 4 word = input() if is_rune_word(word): print("Yes") else: print("No")