from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
T = "indeednow"
counter = Counter(T)
for s in S:
    if len(s) != len(T):
        print("NO")
        continue

    counter2 = Counter(s)
    flag = True
    for k, v in counter2.items():
        if k not in counter:
            flag = False
            break

        if counter[k] != v:
            flag = False
            break
    if flag:
        print("YES")
    else:
        print("NO")
e498ed42df11a9002be442314e0dfb847530b219
<mask token>

<mask token>
for s in S:
    if len(s) != len(T):
        print('NO')
        continue
    counter2 = Counter(s)
    flag = True
    for k, v in counter2.items():
        if k not in counter:
            flag = False
            break
        if counter[k] != v:
            flag = False
            break
    if flag:
        print('YES')
    else:
        print('NO')

<mask token>
N = int(input())
S = [input() for _ in range(N)]
T = 'indeednow'
counter = Counter(T)
for s in S:
    if len(s) != len(T):
        print('NO')
        continue
    counter2 = Counter(s)
    flag = True
    for k, v in counter2.items():
        if k not in counter:
            flag = False
            break
        if counter[k] != v:
            flag = False
            break
    if flag:
        print('YES')
    else:
        print('NO')

from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
T = 'indeednow'
counter = Counter(T)
for s in S:
    if len(s) != len(T):
        print('NO')
        continue
    counter2 = Counter(s)
    flag = True
    for k, v in counter2.items():
        if k not in counter:
            flag = False
            break
        if counter[k] != v:
            flag = False
            break
    if flag:
        print('YES')
    else:
        print('NO')

from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
T = "indeednow"
counter = Counter(T)
for s in S:
    if len(s) != len(T):
        print("NO")
        continue

    counter2 = Counter(s)
    flag = True
    for k, v in counter2.items():
        if k not in counter:
            flag = False
            break

        if counter[k] != v:
            flag = False
            break
    if flag:
        print("YES")
    else:
        print("NO")