Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with friends, that's why all the language's grammar can be described with the following set of rules:

  * There are three parts of speech: the adjective, the noun, the verb. Each word in his language is an adjective, noun or verb. 
  * There are two genders: masculine and feminine. Each word in his language has gender either masculine or feminine. 
  * Masculine adjectives end with -lios, and feminine adjectives end with -liala. 
  * Masculine nouns end with -etr, and feminime nouns end with -etra. 
  * Masculine verbs end with -initis, and feminime verbs end with -inites. 
  * Thus, each word in the Petya's language has one of the six endings, given above. There are no other endings in Petya's language. 
  * It is accepted that the whole word consists of an ending. That is, words "lios", "liala", "etr" and so on belong to the Petya's language. 
  * There aren't any punctuation marks, grammatical tenses, singular/plural forms or other language complications. 
  * A sentence is either exactly one valid language word or exactly one statement. 



Statement is any sequence of the Petya's language, that satisfy both conditions:

  * Words in statement follow in the following order (from the left to the right): zero or more adjectives followed by exactly one noun followed by zero or more verbs. 
  * All words in the statement should have the same gender.



After Petya's friend Vasya wrote instant messenger (an instant messaging program) that supported the Petya's language, Petya wanted to add spelling and grammar checking to the program. As Vasya was in the country and Petya didn't feel like waiting, he asked you to help him with this problem. Your task is to define by a given sequence of words, whether it is true that the given text represents exactly one sentence in Petya's language.

Input

The first line contains one or more words consisting of lowercase Latin letters. The overall number of characters (including letters and spaces) does not exceed 105.

It is guaranteed that any two consecutive words are separated by exactly one space and the input data do not contain any other spaces. It is possible that given words do not belong to the Petya's language.

Output

If some word of the given text does not belong to the Petya's language or if the text contains more that one sentence, print "NO" (without the quotes). Otherwise, print "YES" (without the quotes).

Examples

Input

petr


Output

YES


Input

etis atis animatis etis atis amatis


Output

NO


Input

nataliala kataliala vetra feinites


Output

YES
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys
input = sys.stdin
output = sys.stdout

from collections import Counter

YES = "YES"
NO = "NO"

M = 1
W = 2

ADJ = 1
NOUN = 2
VERB = 3

TYPES = {
         'lios' : (ADJ,M),
         'liala' : (ADJ,W),
         'etr' : (NOUN,M),
         'etra' : (NOUN,W),
         'initis' : (VERB,M),
         'inites' : (VERB,W),
         }

def word_type(w):
    for suffix,wtype in TYPES.iteritems():
        if w.endswith(suffix):
            return wtype
    return (-1,-1)

def solve(W):
    WT = [word_type(w) for w in W]
#    print WT
    
    if not all(wt[0]>0 for wt in WT):
        return NO
    
    if len(W) == 1:
        return YES
    
    sbeg = 0
    while sbeg+1<len(WT) and (WT[sbeg][0] <= WT[sbeg+1][0]):
        sbeg += 1

#    print sbeg
    if sbeg+1 == len(WT):
        
        c = Counter(WT[i][0] for i in range(sbeg+1))
#        print c
        one_noun = (c[NOUN] == 1)
#        print 'one_noun:',one_noun
        
        one_sort = all(WT[i][1]==WT[0][1] for i in range(1,sbeg+1))
#        print 'one_sort',one_sort
        
        if one_noun and one_sort:
            return YES
    
    return NO

W = [s for s in input.readline().strip().split(' ')]

a = solve(W)
output.write('%s\n' % a)
