#!/usr/bin/python3 import re def is_number(test): pattern = re.compile(r'^N(IE{6}|O{6})!{3}$') result = re.match(pattern, test) if result: return "yes" else: return "no" x = input() while x: print(is_number(x)) x = input()