words = raw_input().split()

def classify(k):
    if len(k) < 3:
        return 0
    ans = 0
    if (len(k) >= 3):
        if k[len(k) - 3:] == 'etr':
            return 21
    if (len(k) >= 4):
        if k[len(k) - 4:] == 'lios':
            return 11
        if k[len(k) - 4:] == 'etra':
            return 22
    if (len(k) >= 5):
        if k[len(k) - 5:] == 'liala':
            return 12
    if (len(k) >= 6):
        if k[len(k) - 6:] == 'initis':
            return 31
        if k[len(k) - 6:] == 'inites':
            return 32
    return 0

p, s, g, r = 0, 0, 0, 0
flag = 1
for i in xrange(len(words)):
    if (classify(words[i]) == 0):
        flag = 0
        break
    if (int(str(classify(words[i]) % 100)[0]) == 1):
        if (r != 0 and r != classify(words[i]) % 10):
            flag = 0
            break
        if (r == 0):
            r = classify(words[i]) % 10
        if (s != 0 or g != 0):
            flag = 0
            break
        p += 1
    if (int(str(classify(words[i]) % 100)[0]) == 2):
        if (r != 0 and r != classify(words[i]) % 10):
            flag = 0
            break
        if (r == 0):
            r = classify(words[i]) % 10
        if (g != 0 or s != 0):
            flag = 0
            break
        s += 1
    if (int(str(classify(words[i]) % 100)[0]) == 3):
        if (r != 0 and r != classify(words[i]) % 10):
            flag = 0
            break
        if (r == 0):
            r = classify(words[i]) % 10
        g += 1

if (flag == 0):
    print 'NO'
else:
    print 'YES'


words = raw_input().split()

def classify(k):
    if len(k) < 3:
        return 0
    ans = 0
    if (len(k) >= 3):
        if k[len(k) - 3:] == 'etr':
            return 21
    if (len(k) >= 4):
        if k[len(k) - 4:] == 'lios':
            return 11
        if k[len(k) - 4:] == 'etra':
            return 22
    if (len(k) >= 5):
        if k[len(k) - 5:] == 'liala':
            return 12
    if (len(k) >= 6):
        if k[len(k) - 6:] == 'initis':
            return 31
        if k[len(k) - 6:] == 'inites':
            return 32
    return 0

p, s, g, r = 0, 0, 0, 0
flag = 1
for i in xrange(len(words)):
    if (classify(words[i]) == 0):
        flag = 0
        break
    if (int(str(classify(words[i]) % 100)[0]) == 1):
        if (r != 0 and r != classify(words[i]) % 10):
            flag = 0
            break
        if (r == 0):
            r = classify(words[i]) % 10
        if (s != 0 or g != 0):
            flag = 0
            break
        p += 1
    if (int(str(classify(words[i]) % 100)[0]) == 2):
        if (r != 0 and r != classify(words[i]) % 10):
            flag = 0
            break
        if (r == 0):
            r = classify(words[i]) % 10
        if (g != 0 or s != 0):
            flag = 0
            break
        s += 1
    if (int(str(classify(words[i]) % 100)[0]) == 3):
        if (r != 0 and r != classify(words[i]) % 10):
            flag = 0
            break
        if (r == 0):
            r = classify(words[i]) % 10
        if (s != 1):
            flag = 0
            break
        g += 1

if len(words) == 1 and classify(words[0]) != 0:
    print 'YES'
else:
    if (flag == 0):
        print 'NO'
    else:
        print 'YES'


words = raw_input().split()

def classify(k):
    if len(k) < 3:
        return 0
    ans = 0
    if (len(k) >= 3):
        if k[len(k) - 3:] == 'etr':
            return 21
    if (len(k) >= 4):
        if k[len(k) - 4:] == 'lios':
            return 11
        if k[len(k) - 4:] == 'etra':
            return 22
    if (len(k) >= 5):
        if k[len(k) - 5:] == 'liala':
            return 12
    if (len(k) >= 6):
        if k[len(k) - 6:] == 'initis':
            return 31
        if k[len(k) - 6:] == 'inites':
            return 32
    return 0

p, s, g, r = 0, 0, 0, 0
flag = 1
for i in xrange(len(words)):
    if (classify(words[i]) == 0):
        flag = 0
    if (int(str(classify(words[i]) % 100)[0]) == 1):
        if (r != 0 and r != classify(words[i]) % 10):
            flag = 0
        if (r == 0):
            r = classify(words[i]) % 10
        if (s != 0 or g != 0):
            flag = 0
        p += 1
    if (int(str(classify(words[i]) % 100)[0]) == 2):
        if (r != 0 and r != classify(words[i]) % 10):
            flag = 0
        if (r == 0):
            r = classify(words[i]) % 10
        if (g != 0):
            flag = 0
        s += 1
    if (int(str(classify(words[i]) % 100)[0]) == 3):
        if (r != 0 and r != classify(words[i]) % 10):
            flag = 0
        if (r == 0):
            r = classify(words[i]) % 10
        g += 1

if (flag == 0):
    print 'NO'
else:
    print 'YES'


words = raw_input().split()

def classify(k):
    if len(k) < 3:
        return 0
    ans = 0
    if (len(k) >= 3):
        if k[len(k) - 3:] == 'etr':
            return 21
    if (len(k) >= 4):
        if k[len(k) - 4:] == 'lios':
            return 11
        if k[len(k) - 4:] == 'etra':
            return 22
    if (len(k) >= 5):
        if k[len(k) - 5:] == 'liala':
            return 12
    if (len(k) >= 6):
        if k[len(k) - 6:] == 'initis':
            return 31
        if k[len(k) - 6:] == 'inites':
            return 32
    return 0

p, s, g, r = 0, 0, 0, 0
flag = 1
for i in xrange(len(words)):
    if (classify(words[i]) == 0):
        flag = 0
        break
    if (int(str(classify(words[i]) % 100)[0]) == 1):
        if (r != 0 and r != classify(words[i]) % 10):
            flag = 0
            break
        if (r == 0):
            r = classify(words[i]) % 10
        if (s != 0 or g != 0):
            flag = 0
            break
        p += 1
    if (int(str(classify(words[i]) % 100)[0]) == 2):
        if (r != 0 and r != classify(words[i]) % 10):
            flag = 0
            break
        if (r == 0):
            r = classify(words[i]) % 10
        if (g != 0 or s != 0):
            flag = 0
            break
        s += 1
    if (int(str(classify(words[i]) % 100)[0]) == 3):
        if (r != 0 and r != classify(words[i]) % 10):
            flag = 0
            break
        if (r == 0):
            r = classify(words[i]) % 10
        if (s != 1):
            flag = 0
            break
        g += 1

if (flag == 0):
    print 'NO'
else:
    print 'YES'


words = raw_input().split()

def check(k):
    return k.endswith('lios') or k.endswith('liala') or k.endswith('etr') or k.endswith('etra') or k.endswith('etr') or k.endswith('inites')

def gender(k):
    if k.endswith('lios') or k.endswith('etr') or k.endswith('etr'):
        return 1
    elif check(k):
        return 2
    else:
        return 0

def pos(k):
    if k.endswith('lios') or k.endswith('liala'):
        return 1
    if k.endswith('etr') or k.endswith('etra'):
        return 2
    if k.endswith('initis') or k.endswith('inites'):
        return 3
    return 0

flag = 1
p, s, g, r = 0, 0, 0, 0
for i in xrange(len(words)):
    if check(words[i]) == False:
        flag = 0

if flag == 0:
    print 'NO'
else:
    if len(words[i]) == 1:
        print 'YES'
    else:
        for i in xrange(len(words)):
            if pos(words[i]) == 1:
                if s != 0 or g != 0:
                    flag = 0
                if r != 0 and r != gender(words[i]):
                    flag = 0
                if r == 0:
                    r = gender(words[i])
                p += 1
            if pos(words[i]) == 2:
                if s != 0 or g != 0:
                    flag = 0
                if r != 0 and r != gender(words[i]):
                    flag = 0
                if r == 0:
                    r = gender(words[i])
                s += 1
            if pos(words[i]) == 3:
                if s != 1:
                    flag = 0
                if r != 0 and r != gender(words[i]):
                    flag = 0
                if r == 0:
                    r = gender(words[i])
                g += 1
        if flag == 0:
            print 'NO'
        else:
            print 'YES'


words = raw_input().split()

def classify(k):
    if len(k) < 3:
        return 0
    ans = 0
    if (len(k) >= 3):
        if k[len(k) - 3:] == 'etr':
            return 21
    if (len(k) >= 4):
        if k[len(k) - 4:] == 'lios':
            return 11
        if k[len(k) - 4:] == 'etra':
            return 22
    if (len(k) >= 5):
        if k[len(k) - 5:] == 'liala':
            return 12
    if (len(k) >= 6):
        if k[len(k) - 6:] == 'initis':
            return 31
        if k[len(k) - 6:] == 'inites':
            return 32
    return 0

p, s, g, r = 0, 0, 0, 0
flag = 1
for i in xrange(len(words)):
    if (classify(words[i]) == 0):
        flag = 0
    if (int(str(classify(words[i]) % 100)[0]) == 1):
        if (r != 0 and r != classify(words[i]) % 10):
            flag = 0
        if (r == 0):
            r = classify(words[i]) % 10
        if (s != 0 or g != 0):
            flag = 0
        p += 1
    if (int(str(classify(words[i]) % 100)[0]) == 2):
        if (r != 0 and r != classify(words[i]) % 10):
            flag = 0
        if (r == 0):
            r = classify(words[i]) % 10
        if (g != 0 or s != 0):
            flag = 0
        s += 1
    if (int(str(classify(words[i]) % 100)[0]) == 3):
        if (r != 0 and r != classify(words[i]) % 10):
            flag = 0
        if (r == 0):
            r = classify(words[i]) % 10
        g += 1

if (flag == 0):
    print 'NO'
else:
    print 'YES'


import sys # sys.exit() quit()
readln = lambda: map(int, raw_input().split())
#sys.stdin = open('input.txt','r'); sys.stdout = open('output.txt','w')

v = raw_input().split()

adj = ['lios','liala']
nouns = ['etr' , 'etra']
vb = ['initis','inites']

def checkadj(a):
    if a[-4:] == adj[0] or a[-5:] == adj[1]: return 1
    return 0

def checknoun(a):
    if a[-3:] == nouns[0] or a[-4:] == nouns[1]: return 1
    return 0

def checkvb(a):
    if a[-6:] == vb[0] or a[-6:] == vb[1]: return 1
    return 0

if len(v) == 1:
    if any(v[0].endswith(x) for x in adj+nouns+vb): print 'YES'
    else:
        print "NO"
        sys.exit()
else:
    gender = [[adj[0],vb[0],nouns[0]],[adj[1],vb[1],nouns[1]]]
    masc = False
    fem = False
    for i in xrange(len(v)):
        if any(v[i].endswith(x) for x in gender[0]):
            masc = True
        if any(v[i].endswith(x) for x in gender[1]):
            fem = True
    if masc and fem:
        print "NO"
        sys.exit()
    i=0
    while(i<len(v)):
        if checkadj(v[i]): i+=1
        else: break
    if checknoun(v[i]):
        i+=1
    else:
        print "NO"
        sys.exit()
    while(i<len(v)):
        if checkvb(v[i]): i+=1
        else: break
    if i<len(v):
        print "NO"
        sys.exit()

    print "YES"


import sys # sys.exit() quit()
readln = lambda: map(int, raw_input().split())
#sys.stdin = open('input.txt','r'); sys.stdout = open('output.txt','w')

v = raw_input().split()

adj = ['lios','liala']
nouns = ['etr' , 'etra']
vb = ['initis','inites']

def checkadj(a):
    if a[-4:] == adj[0] or a[-5:] == adj[1]: return 1
    return 0

def checknoun(a):
    if a[-3:] == nouns[0] or a[-4:] == nouns[1]: return 1
    return 0

def checkvb(a):
    if a[-6:] == vb[0] or a[-6:] == vb[1]: return 1
    return 0

if len(v) == 1:
    if any(v[0].endswith(x) for x in adj+nouns+vb): print 'YES'
    else:
        print "NO"
        sys.exit()
else:
    gender = [[adj[0],vb[0],nouns[0]],[adj[1],vb[1],nouns[1]]]
    masc = False
    for i in xrange(len(v)):
        if any(v[i].endswith(x) for x in gender[0]):
            masc = True
        if any(v[i].endswith(x) for x in gender[1]):
            fem = True
    if masc and fem:
        print "NO"
        sys.exit()
    i=0
    while(i<len(v)):
        if checkadj(v[i]): i+=1
        else: break
    if checknoun(v[i]):
        i+=1
    else:
        print "NO"
        sys.exit()
    while(i<len(v)):
        if checkvb(v[i]): i+=1
        else: break
    if i<len(v):
        print "NO"
        sys.exit()

    print "YES"


import sys # sys.exit() quit()
readln = lambda: map(int, raw_input().split())
#sys.stdin = open('input.txt','r'); sys.stdout = open('output.txt','w')

v = raw_input().split()

adj = ['lios','liala']
nouns = ['etr' , 'etra']
vb = ['initis','inites']

def checkadj(a):
    if a[-4:] == adj[0] or a[-5:] == adj[1]: return 1
    return 0

def checknoun(a):
    if a[-3:] == nouns[0] or a[-4:] == nouns[1]: return 1
    return 0

def checkvb(a):
    if a[-6:] == vb[0] or a[-6:] == vb[1]: return 1
    return 0

if len(v) == 1:
    if any(v[0].endswith(x) for x in adj+nouns+vb): print 'YES'
    else:
        print "NO"
        sys.exit()
else:
    gender = [[adj[0],vb[0],nouns[0]],[adj[1],vb[1],nouns[1]]]
    masc = False
    fem = False
    for i in xrange(len(v)):
        if any(v[i].endswith(x) for x in gender[0]):
            masc = True
        if any(v[i].endswith(x) for x in gender[1]):
            fem = True
    if masc and fem:
        print "NO"
        sys.exit()
    i=0
    while(i<len(v)):
        if checkadj(v[i]): i+=1
        else: break
    if i<len(v) and checknoun(v[i]):
        i+=1
    else:
        print "NO"
        sys.exit()
    while(i<len(v)):
        if checkvb(v[i]): i+=1
        else: break
    if i<len(v):
        print "NO"
        sys.exit()

    print "YES"


import sys # sys.exit() quit()
readln = lambda: map(int, raw_input().split())
#sys.stdin = open('input.txt','r'); sys.stdout = open('output.txt','w')

v = raw_input().split()

adj = ['lios','liala']
nouns = ['etr' , 'etra']
vb = ['initis','inites']

def checkadj(a):
    if a[-4:] == adj[0] or a[-5:] == adj[1]: return 1
    return 0

def checknoun(a):
    if a[-3:] == nouns[0] or a[-4:] == nouns[1]: return 1
    return 0

def checkvb(a):
    if a[-6:] == vb[0] or a[-6:] == vb[1]: return 1
    return 0

if len(v) == 1:
    if any(v[0].endswith(x) for x in adj+nouns+vb): print 'YES'
    else:
        print "NO"
        sys.exit()
else:
    gender = [[adj[0],vb[0],nouns[0]],[adj[1],vb[1],nouns[1]]]
    for i in xrange(len(v)):
        if any(v[i].endswith(x) for x in gender[0]) and any(v[i].endswith(x) for x in gender[1]):
            print "NO"
            sys.exit()
    i=0
    while(i<len(v)):
        if checkadj(v[i]): i+=1
        else: break
    if checknoun(v[i]):
        i+=1
    else:
        print "NO"
        sys.exit()
    while(i<len(v)):
        if checkvb(v[i]): i+=1
        else: break
    if i<len(v):
        print "NO"
        sys.exit()

    print "YES"


import sys

words = sys.stdin.readline()[:-1].split()

madj = "lios"
fadj = "liala"

mnoun = "etr"
fnoun = "etra"

mverb = "initis"
fverb = "inites"

m = [madj, mnoun, mverb]
f = [fadj, fnoun, fverb]

MASC = True
FEM = False

def gender(w):
    if w in m:
        return MASC
    else:
        return FEM

def check(words):
    if len(words) == 0:
        return False

    ws = []
    for w in words:
        if w[-4:] == madj or w[-4:] == fnoun:
            ws.append(w[-4:])
        elif w[-5:] == fadj:
            ws.append(w[-5:])
        elif w[-3:] == mnoun:
            ws.append(w[-3:])
        elif w[-6:] == mverb or w[-6:] == fverb:
            ws.append(w[-6:])
        else:
            return False

    if len(ws) == 1:
        return True

    for w in ws:
        if gender(w) != gender(ws[0]):
            return False

    i = 0
    if gender(ws[0]) == MASC:
        while i < len(ws) and ws[i] == madj:
            i += 1
        if i >= len(ws) or ws[i] != mnoun:
            return False
        i += 1
        while i < len(ws) and ws[i] == mverb:
            i += 1

    else:
        i = 0
        while i < len(ws) and ws[i] == fadj:
            i += 1
        if i >= len(ws) or ws[i] != fnoun:
            return False
        i += 1
        while i < len(ws) and ws[i] == fverb:
            i += 1

    if i != len(ws):
        return False

    return True

if check(words):
    print "YES"
else:
    print "NO"


import sys

words = sys.stdin.readline()[:-1].split()

madj = "lios"
fadj = "liala"

mnoun = "etr"
fnoun = "etra"

mverb = "initis"
fverb = "inites"

m = [madj, mnoun, mverb]
f = [fadj, fnoun, fverb]

MASC = True
FEM = False

def gender(w):
    if w in m:
        return MASC
    else:
        return FEM

def check(words):
    if len(words) == 0:
        return False

    ws = []
    for w in words:
        if w[-4:] == madj or w[-4:] == fnoun:
            ws.append(w[-4:])
        elif w[-5:] == fadj:
            ws.append(w[-5:])
        elif w[-3:] == mnoun:
            ws.append(w[-3:])
        elif w[-6:] == mverb or w[-6:] == fverb:
            ws.append(w[-6:])
        else:
            return False

    for w in ws:
        if gender(w) != gender(ws[0]):
            return False

    i = 0
    if gender(ws[0]) == MASC:
        while i < len(ws) and ws[i] == madj:
            i += 1
        if i >= len(ws) or ws[i] != mnoun:
            return False
        i += 1
        while i < len(ws) and ws[i] == mverb:
            i += 1

    else:
        i = 0
        while i < len(ws) and ws[i] == fadj:
            i += 1
        if i >= len(ws) or ws[i] != fnoun:
            return False
        i += 1
        while i < len(ws) and ws[i] == fverb:
            i += 1

    if i != len(ws):
        return False

    return True

if check(words):
    print "YES"
else:
    print "NO"


import sys

words = sys.stdin.readline().split()

madj = "lios"
fadj = "liala"

mnoun = "etr"
fnoun = "etra"

mverb = "initis"
fverb = "inites"

m = [madj, mnoun, mverb]
f = [fadj, fnoun, fverb]

MASC = True
FEM = False

def gender(w):
    if w in m:
        return MASC
    else:
        return FEM

def check(words):
    if len(words) == 0:
        return False

    ws = []
    for w in words:
        if w[-4:] == madj or w[-4:] == fnoun:
            ws.append(w[-4:])
        elif w[-5:] == fadj:
            ws.append(w[-5:])
        elif w[-3:] == mnoun:
            ws.append(w[-3:])
        elif w[-6:] == mverb or w[-6:] == fverb:
            ws.append(w[-6:])
        else:
            return False

    for w in ws:
        if gender(w) != gender(ws[0]):
            return False

    if gender(ws[0]) == MASC:
        i = 0
        while i < len(ws) and ws[i] == madj:
            i += 1
        if ws[i] != mnoun:
            return False
        i += 1
        while i < len(ws) and ws[i] == mverb:
            i += 1
        if i != len(ws):
            return False

    elif gender(ws[0]) == FEM:
        i = 0
        while i < len(ws) and ws[i] == fadj:
            i += 1
        if ws[i] != fnoun:
            return False
        i += 1
        while i < len(ws) and ws[i] == fverb:
            i += 1
        if i != len(ws):
            return False

    return True

if check(words):
    print "YES"
else:
    print "NO"


using System;
using System.IO;
using System.Text.RegularExpressions;

class Program
{
  const string COMBINATION_PATTERN_TEMPLATE = @"(\w*?{0} )*?(\w*?{1})( \w*?{2})*?";

  static string correctInputPattern = string.Format("^({0})|({1})$",
    string.Format(COMBINATION_PATTERN_TEMPLATE, new string[] { "lios", "etr", "initis" }),
    string.Format(COMBINATION_PATTERN_TEMPLATE, new string[] { "liala", "etra", "inites" }));

  static bool InputIsCorrect(string InputStr)
  {
    return Regex.IsMatch(InputStr, correctInputPattern);
  }

  static void Main()
  {
#if !ONLINE_JUDGE
    Console.SetIn(new StreamReader("input.txt"));
    Console.SetOut(new StreamWriter("output.txt"));
#endif
    Console.Write(InputIsCorrect(Console.ReadLine()) ? "YES" : "NO");
  }
}


using System;
using System.IO;
using System.Text.RegularExpressions;

class Program
{
  const string CORRECT_WORDS_TEMPLATE = @"^( |(\w*?{0})|(\w*?{1})|(\w*?{2}))+$";

  static bool InputIsCorrect(string inputStr)
  {
    return Regex.Matches(inputStr, @"etra?\b").Count < 2 &&
      Regex.IsMatch(inputStr, string.Format(@"({0})+|({1})+",
        string.Format(CORRECT_WORDS_TEMPLATE, new string[] { "lios", "etr", "initis" }),
        string.Format(CORRECT_WORDS_TEMPLATE, new string[] { "liala", "etra", "inites" })));
  }

  static void Main()
  {
#if !ONLINE_JUDGE
    Console.SetIn(new StreamReader("input.txt"));
    Console.SetOut(new StreamWriter("output.txt"));
#endif
    Console.Write(InputIsCorrect(Console.ReadLine()) ? "YES" : "NO");
  }
}


using System;
using System.IO;
using System.Collections.Generic;
using System.Text.RegularExpressions;

class Program
{
  const string STATEMENT_PATTERN_TEMPLATE = @"^(({0})|({1}))$";
  const string STATEMENT_TYPE_PATTERN_TEMPLATE = @"(\w*?{0} )*(\w*?{1})+( \w*?{2})*";
  const string SINGLE_WORD_PATTERN_TEMPLATE = @"^\w*?({0}|{1}|{2}|{3}|{4}|{5})$";

  static List<string> Suffs = new List<string> { "lios", "etr", "initis", "liala", "etra", "inites" };

  static string SingleWordPattern()
  {
    return string.Format(SINGLE_WORD_PATTERN_TEMPLATE, Suffs.ToArray());
  }

  static string StatementPatternForGender(bool male)
  {
    string[] suffixList = Suffs.GetRange((male ? 0 : 3), 3).ToArray();
    return string.Format(STATEMENT_TYPE_PATTERN_TEMPLATE, suffixList);
  }

  static string StatementPattern()
  {
    return string.Format(STATEMENT_PATTERN_TEMPLATE,
      StatementPatternForGender(true), StatementPatternForGender(false));
  }

  static bool StatementIsSingleWord(string inputStr)
  {
    return Regex.IsMatch(inputStr, SingleWordPattern());
  }

  static bool StatementIsCorrectCombination(string inputStr)
  {
    return Regex.IsMatch(inputStr, StatementPattern());
  }

  static bool StatementIsCorrect(string inputStr)
  {
    return StatementIsSingleWord(inputStr) || StatementIsCorrectCombination(inputStr);
  }

  static void Main()
  {
#if !ONLINE_JUDGE
    Console.SetIn(new StreamReader("input.txt"));
    Console.SetOut(new StreamWriter("output.txt"));
#endif
    Console.Write(StatementIsCorrect(Console.ReadLine()) ? "YES" : "NO");
  }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            int mode = 1;
            string[] verbs = Console.ReadLine().Split();
            if (verbs.Length>0)
                if (verbs.Length == 1)
                {
                    string word = verbs[0];
                    if (verbs[0].Length > 2)
                        if (verbs[0].Substring(verbs[0].Length - 3, 3) == "etr")
                            Console.WriteLine("YES");
                        else
                            if (verbs[0].Length > 3)
                                if ((verbs[0].Substring(verbs[0].Length - 4, 4) == "lios"))
                                    Console.WriteLine("YES");
                                else if (verbs[0].Substring(verbs[0].Length - 4, 4) == "etra")
                                    Console.WriteLine("YES");
                                else
                                    if (verbs[0].Length > 4)
                                        if (verbs[0].Substring(verbs[0].Length - 5, 5) == "liosa")
                                            Console.WriteLine("YES");
                                        else if (verbs[0].Length > 5)
                                            if (verbs[0].Substring(verbs[0].Length - 6, 6) == "initis")
                                                Console.WriteLine("YES");
                                            else if (verbs[0].Substring(verbs[0].Length - 6, 6) == "inites")
                                                Console.WriteLine("YES");
                                            else Console.WriteLine("NO");
                                        else Console.WriteLine("NO");
                                    else Console.WriteLine("NO");
                            else Console.WriteLine("NO");
                    else Console.WriteLine("NO");
                }
                else
                {
                    char[] st=new char[verbs.Length];
                    for (int i = 0; i < verbs.Length; i++)
                    {
                        if (verbs[i].Length > 2)
                            if (verbs[i].Substring(verbs[i].Length - 3, 3) == "etr")
                                st[i] = 'n';
                            else
                                if (verbs[i].Length > 3)
                                    if ((verbs[i].Substring(verbs[i].Length - 4, 4) == "lios"))
                                        st[i] = 'a';
                                    else if (verbs[i].Substring(verbs[i].Length - 4, 4) == "etra")
                                        st[i] = 'n';
                                    else
                                        if (verbs[i].Length > 4)
                                            if (verbs[i].Substring(verbs[i].Length - 5, 5) == "liosa")
                                                st[i] = 'a';
                                            else if (verbs[i].Length > 5)
                                                if (verbs[i].Substring(verbs[i].Length - 6, 6) == "initis")
                                                    st[i] = 'v';
                                                else if (verbs[i].Substring(verbs[i].Length - 6, 6) == "inites")
                                                    st[i] = 'v';
                                                else
                                                {
                                                    mode=0;
                                                    break;
                                                }
                                            else
                                            {
                                                mode=0;
                                                break;
                                            }
                                        else
                                        {
                                            mode=0;
                                            break;
                                        }
                                else
                                {
                                    mode=0;
                                    break;
                                }
                        else
                        {
                            mode=0;
                            break;
                        }
                        if (i > 0)
                            if (st[i] == 'a')
                            {
                                if (st[i-1]!='a')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'n')
                            {
                                if (st[i - 1] != 'a')
                                {
                                    mode = 0;
                                    break;
                                }
                            } else if (st[i]=='v')
                                if (st[i - 1] == 'a')
                                {
                                    mode = 0;
                                    break;
                                }
                    }
                    if (mode == 0)
                        Console.WriteLine("NO");
                    else Console.WriteLine("YES");
                }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            int mode = 1;
            string[] verbs = Console.ReadLine().Split();
            if (verbs.Length > 0)
                if (verbs.Length == 1)
                {
                    string word = verbs[0];
                    if (verbs[0].Length > 2)
                        if (verbs[0].Substring(verbs[0].Length - 3, 3) == "etr")
                            Console.WriteLine("YES");
                        else
                            if (verbs[0].Length > 3)
                                if ((verbs[0].Substring(verbs[0].Length - 4, 4) == "lios"))
                                    Console.WriteLine("YES");
                                else if (verbs[0].Substring(verbs[0].Length - 4, 4) == "etra")
                                    Console.WriteLine("YES");
                                else
                                    if (verbs[0].Length > 4)
                                        if (verbs[0].Substring(verbs[0].Length - 5, 5) == "liala")
                                            Console.WriteLine("YES");
                                        else if (verbs[0].Length > 5)
                                            if (verbs[0].Substring(verbs[0].Length - 6, 6) == "initis")
                                                Console.WriteLine("YES");
                                            else if (verbs[0].Substring(verbs[0].Length - 6, 6) == "inites")
                                                Console.WriteLine("YES");
                                            else Console.WriteLine("NO");
                                        else Console.WriteLine("NO");
                                    else Console.WriteLine("NO");
                            else Console.WriteLine("NO");
                    else Console.WriteLine("NO");
                }
                else
                {
                    char[] st = new char[verbs.Length];
                    for (int i = 0; i < verbs.Length; i++)
                    {
                        if (verbs[i].Length > 2)
                            if (verbs[i].Substring(verbs[i].Length - 3, 3) == "etr")
                                st[i] = 'n';
                            else
                                if (verbs[i].Length > 3)
                                    if ((verbs[i].Substring(verbs[i].Length - 4, 4) == "lios"))
                                        st[i] = 'a';
                                    else if (verbs[i].Substring(verbs[i].Length - 4, 4) == "etra")
                                        st[i] = 'm';
                                    else
                                        if (verbs[i].Length > 4)
                                            if (verbs[i].Substring(verbs[i].Length - 5, 5) == "liala")
                                                st[i] = 'b';
                                            else if (verbs[i].Length > 5)
                                                if (verbs[i].Substring(verbs[i].Length - 6, 6) == "initis")
                                                    st[i] = 'v';
                                                else if (verbs[i].Substring(verbs[i].Length - 6, 6) == "inites")
                                                    st[i] = 'w';
                                                else
                                                {
                                                    mode = 0;
                                                    break;
                                                }
                                            else
                                            {
                                                mode = 0;
                                                break;
                                            }
                                        else
                                        {
                                            mode = 0;
                                            break;
                                        }
                                else
                                {
                                    mode = 0;
                                    break;
                                }
                        else
                        {
                            mode = 0;
                            break;
                        }
                        if (i > 0)
                        {
                            if (st[i] == 'a')
                            {
                                if (st[i - 1] != 'a')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'n')
                            {
                                if (st[i - 1] != 'a')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'v')
                                if ((st[i - 1] != 'n')||(st[i-1]!='v'))
                                {
                                    mode = 0;
                                    break;
                                }
                             if (st[i] == 'b')
                            {
                                if (st[i - 1] != 'b')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'm')
                            {
                                if (st[i - 1] != 'b')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'w')
                                if ((st[i - 1] != 'm')||(st[i-1]!='w'))
                                {
                                    mode = 0;
                                    break;
                                }
                        }
                    }
                    if (mode == 0)
                        Console.WriteLine("NO");
                    else Console.WriteLine("YES");
                }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            int mode = 1;
            string[] verbs = Console.ReadLine().Split();
            if (verbs.Length > 0)
                if (verbs.Length == 1)
                {
                    string word = verbs[0];
                    if (verbs[0].Length > 2)
                        if (verbs[0].Substring(verbs[0].Length - 3, 3) == "etr")
                            Console.WriteLine("YES");
                        else
                            if (verbs[0].Length > 3)
                                if ((verbs[0].Substring(verbs[0].Length - 4, 4) == "lios"))
                                    Console.WriteLine("YES");
                                else if (verbs[0].Substring(verbs[0].Length - 4, 4) == "etra")
                                    Console.WriteLine("YES");
                                else
                                    if (verbs[0].Length > 4)
                                        if (verbs[0].Substring(verbs[0].Length - 5, 5) == "liala")
                                            Console.WriteLine("YES");
                                        else if (verbs[0].Length > 5)
                                            if (verbs[0].Substring(verbs[0].Length - 6, 6) == "initis")
                                                Console.WriteLine("YES");
                                            else if (verbs[0].Substring(verbs[0].Length - 6, 6) == "inites")
                                                Console.WriteLine("YES");
                                            else Console.WriteLine("NO");
                                        else Console.WriteLine("NO");
                                    else Console.WriteLine("NO");
                            else Console.WriteLine("NO");
                    else Console.WriteLine("NO");
                }
                else
                {
                    char[] st = new char[verbs.Length];
                    for (int i = 0; i < verbs.Length; i++)
                    {
                        if (verbs[i].Length > 2)
                            if (verbs[i].Substring(verbs[i].Length - 3, 3) == "etr")
                                st[i] = 'n';
                            else
                                if (verbs[i].Length > 3)
                                    if ((verbs[i].Substring(verbs[i].Length - 4, 4) == "lios"))
                                        st[i] = 'a';
                                    else if (verbs[i].Substring(verbs[i].Length - 4, 4) == "etra")
                                        st[i] = 'm';
                                    else
                                        if (verbs[i].Length > 4)
                                            if (verbs[i].Substring(verbs[i].Length - 5, 5) == "liala")
                                                st[i] = 'b';
                                            else if (verbs[i].Length > 5)
                                                if (verbs[i].Substring(verbs[i].Length - 6, 6) == "initis")
                                                    st[i] = 'v';
                                                else if (verbs[i].Substring(verbs[i].Length - 6, 6) == "inites")
                                                    st[i] = 'w';
                                                else
                                                {
                                                    mode = 0;
                                                    break;
                                                }
                                            else
                                            {
                                                mode = 0;
                                                break;
                                            }
                                        else
                                        {
                                            mode = 0;
                                            break;
                                        }
                                else
                                {
                                    mode = 0;
                                    break;
                                }
                        else
                        {
                            mode = 0;
                            break;
                        }
                        if (i > 0)
                        {
                            if (st[i] == 'a')
                            {
                                if (st[i - 1] != 'a')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'n')
                            {
                                if (st[i - 1] != 'a')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'v')
                                if (st[i - 1] == 'a')
                                {
                                    mode = 0;
                                    break;
                                }
                             if (st[i] == 'b')
                            {
                                if (st[i - 1] != 'b')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'm')
                            {
                                if (st[i - 1] != 'b')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'w')
                                if (st[i - 1] == 'b')
                                {
                                    mode = 0;
                                    break;
                                }
                        }
                    }
                    if (mode == 0)
                        Console.WriteLine("NO");
                    else Console.WriteLine("YES");
                }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            int mode = 1;
            string[] verbs = Console.ReadLine().Split();
            if (verbs.Length > 0)
                if (verbs.Length == 1)
                {
                    string word = verbs[0];
                    if (verbs[0].Length > 2)
                        if (verbs[0].Substring(verbs[0].Length - 3, 3) == "etr")
                            Console.WriteLine("YES");
                        else
                            if (verbs[0].Length > 3)
                                if ((verbs[0].Substring(verbs[0].Length - 4, 4) == "lios"))
                                    Console.WriteLine("YES");
                                else if (verbs[0].Substring(verbs[0].Length - 4, 4) == "etra")
                                    Console.WriteLine("YES");
                                else
                                    if (verbs[0].Length > 4)
                                        if (verbs[0].Substring(verbs[0].Length - 5, 5) == "liala")
                                            Console.WriteLine("YES");
                                        else if (verbs[0].Length > 5)
                                            if (verbs[0].Substring(verbs[0].Length - 6, 6) == "initis")
                                                Console.WriteLine("YES");
                                            else if (verbs[0].Substring(verbs[0].Length - 6, 6) == "inites")
                                                Console.WriteLine("YES");
                                            else Console.WriteLine("NO");
                                        else Console.WriteLine("NO");
                                    else Console.WriteLine("NO");
                            else Console.WriteLine("NO");
                    else Console.WriteLine("NO");
                }
                else
                {
                    char[] st = new char[verbs.Length];
                    for (int i = 0; i < verbs.Length; i++)
                    {
                        if (verbs[i].Length > 2)
                            if (verbs[i].Substring(verbs[i].Length - 3, 3) == "etr")
                                st[i] = 'n';
                            else
                                if (verbs[i].Length > 3)
                                    if ((verbs[i].Substring(verbs[i].Length - 4, 4) == "lios"))
                                        st[i] = 'a';
                                    else if (verbs[i].Substring(verbs[i].Length - 4, 4) == "etra")
                                        st[i] = 'm';
                                    else
                                        if (verbs[i].Length > 4)
                                            if (verbs[i].Substring(verbs[i].Length - 5, 5) == "liala")
                                                st[i] = 'b';
                                            else if (verbs[i].Length > 5)
                                                if (verbs[i].Substring(verbs[i].Length - 6, 6) == "initis")
                                                    st[i] = 'v';
                                                else if (verbs[i].Substring(verbs[i].Length - 6, 6) == "inites")
                                                    st[i] = 'w';
                                                else
                                                {
                                                    mode = 0;
                                                    break;
                                                }
                                            else
                                            {
                                                mode = 0;
                                                break;
                                            }
                                        else
                                        {
                                            mode = 0;
                                            break;
                                        }
                                else
                                {
                                    mode = 0;
                                    break;
                                }
                        else
                        {
                            mode = 0;
                            break;
                        }
                        if (i > 0)
                        {
                            if (st[i] == 'a')
                            {
                                if (st[i - 1] != 'a')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'n')
                            {
                                if (st[i - 1] != 'a')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'v')
                                if ((st[i - 1] != 'n')&&(st[i-1]!='v'))
                                {
                                    mode = 0;
                                    break;
                                }
                             if (st[i] == 'b')
                            {
                                if (st[i - 1] != 'b')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'm')
                            {
                                if (st[i - 1] != 'b')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'w')
                                if ((st[i - 1] != 'm')&&(st[i-1]!='w'))
                                {
                                    mode = 0;
                                    break;
                                }
                        }
                    }
                    int c=0;
                    for (int k = 0; k < st.Length; k++)
                    {
                        if ((st[k] == 'n')||(st[k]=='m')) c = c + 1;
                    }
                            if (c==0) mode=0;
                        if (mode == 0)
                            Console.WriteLine("NO");
                        else Console.WriteLine("YES");
                }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            int mode = 1;
            string[] verbs = Console.ReadLine().Split();
            if (verbs.Length > 0)
                if (verbs.Length == 1)
                {
                    string word = verbs[0];
                    if (verbs[0].Length > 2)
                        if (verbs[0].Substring(verbs[0].Length - 3, 3) == "etr")
                            Console.WriteLine("YES");
                        else
                            if (verbs[0].Length > 3)
                                if ((verbs[0].Substring(verbs[0].Length - 4, 4) == "lios"))
                                    Console.WriteLine("YES");
                                else if (verbs[0].Substring(verbs[0].Length - 4, 4) == "etra")
                                    Console.WriteLine("YES");
                                else
                                    if (verbs[0].Length > 4)
                                        if (verbs[0].Substring(verbs[0].Length - 5, 5) == "liala")
                                            Console.WriteLine("YES");
                                        else if (verbs[0].Length > 5)
                                            if (verbs[0].Substring(verbs[0].Length - 6, 6) == "initis")
                                                Console.WriteLine("YES");
                                            else if (verbs[0].Substring(verbs[0].Length - 6, 6) == "inites")
                                                Console.WriteLine("YES");
                                            else Console.WriteLine("NO");
                                        else Console.WriteLine("NO");
                                    else Console.WriteLine("NO");
                            else Console.WriteLine("NO");
                    else Console.WriteLine("NO");
                }
                else
                {
                    char[] st = new char[verbs.Length];
                    for (int i = 0; i < verbs.Length; i++)
                    {
                        if (verbs[i].Length > 2)
                            if (verbs[i].Substring(verbs[i].Length - 3, 3) == "etr")
                                st[i] = 'n';
                            else
                                if (verbs[i].Length > 3)
                                    if ((verbs[i].Substring(verbs[i].Length - 4, 4) == "lios"))
                                        st[i] = 'a';
                                    else if (verbs[i].Substring(verbs[i].Length - 4, 4) == "etra")
                                        st[i] = 'm';
                                    else
                                        if (verbs[i].Length > 4)
                                            if (verbs[i].Substring(verbs[i].Length - 5, 5) == "liala")
                                                st[i] = 'b';
                                            else if (verbs[i].Length > 5)
                                                if (verbs[i].Substring(verbs[i].Length - 6, 6) == "initis")
                                                    st[i] = 'v';
                                                else if (verbs[i].Substring(verbs[i].Length - 6, 6) == "inites")
                                                    st[i] = 'w';
                                                else
                                                {
                                                    mode = 0;
                                                    break;
                                                }
                                            else
                                            {
                                                mode = 0;
                                                break;
                                            }
                                        else
                                        {
                                            mode = 0;
                                            break;
                                        }
                                else
                                {
                                    mode = 0;
                                    break;
                                }
                        else
                        {
                            mode = 0;
                            break;
                        }
                        if (i > 0)
                        {
                            if (st[i] == 'a')
                            {
                                if (st[i - 1] != 'a')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'n')
                            {
                                if (st[i - 1] != 'a')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'v')
                                if ((st[i - 1] != 'n')&&(st[i-1]!='v'))
                                {
                                    mode = 0;
                                    break;
                                }
                             if (st[i] == 'b')
                            {
                                if (st[i - 1] != 'b')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'm')
                            {
                                if (st[i - 1] != 'b')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'w')
                                if ((st[i - 1] != 'm')&&(st[i-1]!='w'))
                                {
                                    mode = 0;
                                    break;
                                }
                        }
                    }
                    int c=0;
                    for (int k = 0; k < st.Length; k++)
                    {
                        if (st[k] == 'n') c = c + 1;
                    }
                            if (c==0) mode=0;
                        if (mode == 0)
                            Console.WriteLine("NO");
                        else Console.WriteLine("YES");
                }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            int mode = 1;
            string[] verbs = Console.ReadLine().Split();
            if (verbs.Length > 0)
                if (verbs.Length == 1)
                {
                    string word = verbs[0];
                    if (verbs[0].Length > 2)
                        if (verbs[0].Substring(verbs[0].Length - 3, 3) == "etr")
                            Console.WriteLine("YES");
                        else
                            if (verbs[0].Length > 3)
                                if ((verbs[0].Substring(verbs[0].Length - 4, 4) == "lios"))
                                    Console.WriteLine("YES");
                                else if (verbs[0].Substring(verbs[0].Length - 4, 4) == "etra")
                                    Console.WriteLine("YES");
                                else
                                    if (verbs[0].Length > 4)
                                        if (verbs[0].Substring(verbs[0].Length - 5, 5) == "liala")
                                            Console.WriteLine("YES");
                                        else if (verbs[0].Length > 5)
                                            if (verbs[0].Substring(verbs[0].Length - 6, 6) == "initis")
                                                Console.WriteLine("YES");
                                            else if (verbs[0].Substring(verbs[0].Length - 6, 6) == "inites")
                                                Console.WriteLine("YES");
                                            else Console.WriteLine("NO");
                                        else Console.WriteLine("NO");
                                    else Console.WriteLine("NO");
                            else Console.WriteLine("NO");
                    else Console.WriteLine("NO");
                }
                else
                {
                    char[] st = new char[verbs.Length];
                    for (int i = 0; i < verbs.Length; i++)
                    {
                        if (verbs[i].Length > 2)
                            if (verbs[i].Substring(verbs[i].Length - 3, 3) == "etr")
                                st[i] = 'n';
                            else
                                if (verbs[i].Length > 3)
                                    if ((verbs[i].Substring(verbs[i].Length - 4, 4) == "lios"))
                                        st[i] = 'a';
                                    else if (verbs[i].Substring(verbs[i].Length - 4, 4) == "etra")
                                        st[i] = 'm';
                                    else
                                        if (verbs[i].Length > 4)
                                            if (verbs[i].Substring(verbs[i].Length - 5, 5) == "liala")
                                                st[i] = 'b';
                                            else if (verbs[i].Length > 5)
                                                if (verbs[i].Substring(verbs[i].Length - 6, 6) == "initis")
                                                    st[i] = 'v';
                                                else if (verbs[i].Substring(verbs[i].Length - 6, 6) == "inites")
                                                    st[i] = 'w';
                                                else
                                                {
                                                    mode = 0;
                                                    break;
                                                }
                                            else
                                            {
                                                mode = 0;
                                                break;
                                            }
                                        else
                                        {
                                            mode = 0;
                                            break;
                                        }
                                else
                                {
                                    mode = 0;
                                    break;
                                }
                        else
                        {
                            mode = 0;
                            break;
                        }
                        if (i > 0)
                        {
                            if (st[i] == 'a')
                            {
                                if (st[i - 1] != 'a')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'n')
                            {
                                if (st[i - 1] != 'a')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'v')
                                if ((st[i - 1] != 'n')&&(st[i-1]!='v'))
                                {
                                    mode = 0;
                                    break;
                                }
                             if (st[i] == 'b')
                            {
                                if (st[i - 1] != 'b')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'm')
                            {
                                if (st[i - 1] != 'b')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'w')
                                if ((st[i - 1] != 'm')&&(st[i-1]!='w'))
                                {
                                    mode = 0;
                                    break;
                                }
                        }
                    }
                    if (mode == 0)
                        Console.WriteLine("NO");
                    else Console.WriteLine("YES");
                }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            int mode = 1;
            string[] verbs = Console.ReadLine().Split();
            if (verbs.Length>0)
                if (verbs.Length == 1)
                {
                    string word = verbs[0];
                    if (verbs[0].Length > 2)
                        if (verbs[0].Substring(verbs[0].Length - 3, 3) == "etr")
                            Console.WriteLine("YES");
                        else
                            if (verbs[0].Length > 3)
                                if ((verbs[0].Substring(verbs[0].Length - 4, 4) == "lios"))
                                    Console.WriteLine("YES");
                                else if (verbs[0].Substring(verbs[0].Length - 4, 4) == "etra")
                                    Console.WriteLine("YES");
                                else
                                    if (verbs[0].Length > 4)
                                        if (verbs[0].Substring(verbs[0].Length - 5, 5) == "liala")
                                            Console.WriteLine("YES");
                                        else if (verbs[0].Length > 5)
                                            if (verbs[0].Substring(verbs[0].Length - 6, 6) == "initis")
                                                Console.WriteLine("YES");
                                            else if (verbs[0].Substring(verbs[0].Length - 6, 6) == "inites")
                                                Console.WriteLine("YES");
                                            else Console.WriteLine("NO");
                                        else Console.WriteLine("NO");
                                    else Console.WriteLine("NO");
                            else Console.WriteLine("NO");
                    else Console.WriteLine("NO");
                }
                else
                {
                    char[] st=new char[verbs.Length];
                    for (int i = 0; i < verbs.Length; i++)
                    {
                        if (verbs[i].Length > 2)
                            if (verbs[i].Substring(verbs[i].Length - 3, 3) == "etr")
                                st[i] = 'n';
                            else
                                if (verbs[i].Length > 3)
                                    if ((verbs[i].Substring(verbs[i].Length - 4, 4) == "lios"))
                                        st[i] = 'a';
                                    else if (verbs[i].Substring(verbs[i].Length - 4, 4) == "etra")
                                        st[i] = 'n';
                                    else
                                        if (verbs[i].Length > 4)
                                            if (verbs[i].Substring(verbs[i].Length - 5, 5) == "liala")
                                                st[i] = 'a';
                                            else if (verbs[i].Length > 5)
                                                if (verbs[i].Substring(verbs[i].Length - 6, 6) == "initis")
                                                    st[i] = 'v';
                                                else if (verbs[i].Substring(verbs[i].Length - 6, 6) == "inites")
                                                    st[i] = 'v';
                                                else
                                                {
                                                    mode=0;
                                                    break;
                                                }
                                            else
                                            {
                                                mode=0;
                                                break;
                                            }
                                        else
                                        {
                                            mode=0;
                                            break;
                                        }
                                else
                                {
                                    mode=0;
                                    break;
                                }
                        else
                        {
                            mode=0;
                            break;
                        }
                        if (i > 0)
                            if (st[i] == 'a')
                            {
                                if (st[i-1]!='a')
                                {
                                    mode = 0;
                                    break;
                                }
                            }
                            else if (st[i] == 'n')
                            {
                                if (st[i - 1] != 'a')
                                {
                                    mode = 0;
                                    break;
                                }
                            } else if (st[i]=='v')
                                if (st[i - 1] == 'a')
                                {
                                    mode = 0;
                                    break;
                                }
                    }
                    if (mode == 0)
                        Console.WriteLine("NO");
                    else Console.WriteLine("YES");
                }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Globalization;

namespace Task
{
    #region MyIo

    class MyIo : IDisposable
    {
        TextReader inputStream;
        TextWriter outputStream = Console.Out;

        string[] tokens;
        int pointer;

        public MyIo(TextReader inputStream)
        {
            this.inputStream = inputStream;
        }

        public string NextLine()
        {
            try
            {
                return inputStream.ReadLine();
            }
            catch (IOException)
            {
                return null;
            }
        }

        public string NextString()
        {
            try
            {
                while (tokens == null || pointer >= tokens.Length)
                {
                    tokens = NextLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                    pointer = 0;
                }
                return tokens[pointer++];
            }
            catch (IOException)
            {
                return null;
            }
        }

        public int NextInt()
        {
            return int.Parse(NextString());
        }

        public long NextLong()
        {
            return long.Parse(NextString());
        }

        public void Print(string format, params object[] args)
        {
            outputStream.Write(string.Format(CultureInfo.InvariantCulture, format, args));
        }

        public void PrintLine(string format, params object[] args)
        {
            Print(format, args);

            outputStream.WriteLine();
        }

        public void Print<T>(T o)
        {
            outputStream.Write(o);
        }

        public void PrintLine<T>(T o)
        {
            outputStream.WriteLine(o);
        }

        public void Close()
        {
            inputStream.Close();
            outputStream.Close();
        }

        void IDisposable.Dispose()
        {
            Close();
        }
    }
    #endregion

    class Program
    {
        #region Program
        MyIo io;

        public Program(MyIo io)
        {
            this.io = io;
        }

        static void Main(string[] args)
        {
#if  LOCAL_TEST
            using (MyIo io = new MyIo(new StreamReader("input.txt")))
#else
                using (MyIo io = new MyIo(System.Console.In))
#endif

            {
                new Program(io)
                    .Solve();

#if  LOCAL_TEST
                Console.ReadLine();
#endif
            }
        }

        #endregion

        public int CheckWord(string s, int start, int end, out int sx)
        {
            int len = end - start + 1;

            sx = -1;

            if (len < 3)
                return -1;

            string[] words = new string[] { "  lios", " liala", "   etr", "  etra", "initis", "inites" };

            int[] wnums = new int[] { 4, 5, 3, 4, 6, 6 };

            for (int i = 0; i < Math.Min(len, 6); i++)
            {
                for (int j = 0; j < words.Length; j++)
                {
                    char wj = words[j][5 - i];

                    if (wj == ' ')
                        continue;

                    if (wj== s[end - i])
                        wnums[j]--;

                    if (wnums[j] == 0)
                    {
                        sx = (j % 2);
                        return (j / 2);
                    }
                }
            }

            return -1;
        }

        void Solve()
        {
            io.Print(ReSolve() ? "YES" : "NO");
        }

        private bool ReSolve()
        {
            string predl = io.NextLine();

            if (predl.Length < 3)
                return false;

            int s = 0;
            int e = predl.IndexOf(" ", s) - 1;

            if (e < 0)
                e = predl.Length - 1;

            int[] res = new int[3];

            int p = 0;
            int ps, psx = -1;

            while (true)
            {
                int xres = CheckWord(predl, s, e, out ps);

                if (psx < 0)
                    psx = ps;

                if (psx != ps)
                    return false;

                if (xres < p)
                    return false;

                p = xres;

                res[xres]++;

                if ((res[0] + res[1] + res[2] > 1 && res[1] == 0 && res[2] > 0) || res[1] > 1)
                    return false;

                s = e + 2;

                if (s >= predl.Length)
                    break;

                e = predl.IndexOf(" ", s) - 1;

                if (e < 0)
                    e = predl.Length - 1;

            }

            return (res[1] > 0) || (res[0] + res[1] + res[2]  == 1);
        }

    }
}


using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Globalization;

namespace Task
{
    #region MyIo

    class MyIo : IDisposable
    {
        TextReader inputStream;
        TextWriter outputStream = Console.Out;

        string[] tokens;
        int pointer;

        public MyIo(TextReader inputStream)
        {
            this.inputStream = inputStream;
        }

        public string NextLine()
        {
            try
            {
                return inputStream.ReadLine();
            }
            catch (IOException)
            {
                return null;
            }
        }

        public string NextString()
        {
            try
            {
                while (tokens == null || pointer >= tokens.Length)
                {
                    tokens = NextLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                    pointer = 0;
                }
                return tokens[pointer++];
            }
            catch (IOException)
            {
                return null;
            }
        }

        public int NextInt()
        {
            return int.Parse(NextString());
        }

        public long NextLong()
        {
            return long.Parse(NextString());
        }

        public void Print(string format, params object[] args)
        {
            outputStream.Write(string.Format(CultureInfo.InvariantCulture, format, args));
        }

        public void PrintLine(string format, params object[] args)
        {
            Print(format, args);

            outputStream.WriteLine();
        }

        public void Print<T>(T o)
        {
            outputStream.Write(o);
        }

        public void PrintLine<T>(T o)
        {
            outputStream.WriteLine(o);
        }

        public void Close()
        {
            inputStream.Close();
            outputStream.Close();
        }

        void IDisposable.Dispose()
        {
            Close();
        }
    }
    #endregion

    class Program
    {
        #region Program
        MyIo io;

        public Program(MyIo io)
        {
            this.io = io;
        }

        static void Main(string[] args)
        {
#if  LOCAL_TEST
            using (MyIo io = new MyIo(new StreamReader("input.txt")))
#else
                using (MyIo io = new MyIo(System.Console.In))
#endif

            {
                new Program(io)
                    .Solve();

#if  LOCAL_TEST
                Console.ReadLine();
#endif
            }
        }

        #endregion

        public int CheckWord(string s, int start, int end, out int sx)
        {
            int len = end - start + 1;

            sx = -1;

            if (len < 3)
                return -1;

            string[] words = new string[] { "  lios", " liala", "   etr", "  etra", "initis", "inites" };

            int[] wnums = new int[] { 4, 5, 3, 4, 6, 6 };

            for (int i = 0; i < Math.Min(len, 6); i++)
            {
                for (int j = 0; j < words.Length; j++)
                {
                    char wj = words[j][5 - i];

                    if (wj == ' ')
                        continue;

                    if (wj== s[end - i])
                        wnums[j]--;

                    if (wnums[j] == 0)
                    {
                        sx = (j % 2);
                        return (j / 2);
                    }
                }
            }

            return -1;
        }

        void Solve()
        {
            io.Print(ReSolve() ? "YES" : "NO");
        }

        private bool ReSolve()
        {
            string predl = io.NextLine();

            if (predl.Length < 3)
                return false;

            int s = 0;
            int e = predl.IndexOf(" ", s) - 1;

            if (e < 0)
                e = predl.Length - 1;

            int[] res = new int[3];

            int p = 0;
            int ps, psx = -1;

            while (true)
            {
                io.PrintLine(predl.Substring(s, e - s + 1));

                int xres = CheckWord(predl, s, e, out ps);

                if (psx < 0)
                    psx = ps;

                if (psx != ps)
                    return false;

                if (xres < p)
                    return false;

                p = xres;

                res[xres]++;

                if ((res[2] > 0 && res[1] == 0) || res[1] > 1)
                    return false;

                s = e + 2;

                if (s >= predl.Length)
                    break;

                e = predl.IndexOf(" ", s) - 1;

                if (e < 0)
                    e = predl.Length - 1;

            }

            io.PrintLine(res[0] + res[1] + res[2]);

            return (res[1] > 0) || (res[0] + res[1] + res[2]  == 1);
        }

    }
}


using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Globalization;

namespace Task
{
    #region MyIo

    class MyIo : IDisposable
    {
        TextReader inputStream;
        TextWriter outputStream = Console.Out;

        string[] tokens;
        int pointer;

        public MyIo(TextReader inputStream)
        {
            this.inputStream = inputStream;
        }

        public string NextLine()
        {
            try
            {
                return inputStream.ReadLine();
            }
            catch (IOException)
            {
                return null;
            }
        }

        public string NextString()
        {
            try
            {
                while (tokens == null || pointer >= tokens.Length)
                {
                    tokens = NextLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                    pointer = 0;
                }
                return tokens[pointer++];
            }
            catch (IOException)
            {
                return null;
            }
        }

        public int NextInt()
        {
            return int.Parse(NextString());
        }

        public long NextLong()
        {
            return long.Parse(NextString());
        }

        public void Print(string format, params object[] args)
        {
            outputStream.Write(string.Format(CultureInfo.InvariantCulture, format, args));
        }

        public void PrintLine(string format, params object[] args)
        {
            Print(format, args);

            outputStream.WriteLine();
        }

        public void Print<T>(T o)
        {
            outputStream.Write(o);
        }

        public void PrintLine<T>(T o)
        {
            outputStream.WriteLine(o);
        }

        public void Close()
        {
            inputStream.Close();
            outputStream.Close();
        }

        void IDisposable.Dispose()
        {
            Close();
        }
    }
    #endregion

    class Program
    {
        #region Program
        MyIo io;

        public Program(MyIo io)
        {
            this.io = io;
        }

        static void Main(string[] args)
        {
#if  LOCAL_TEST
            using (MyIo io = new MyIo(new StreamReader("input.txt")))
#else
                using (MyIo io = new MyIo(System.Console.In))
#endif

            {
                new Program(io)
                    .Solve();

#if  LOCAL_TEST
                Console.ReadLine();
#endif
            }
        }

        #endregion

        public int CheckWord(string s, int start, int end, out int sx)
        {
            int len = end - start + 1;

            sx = -1;

            if (len < 3)
                return -1;

            string[] words = new string[] { "  lios", " liala", "   etr", "  etra", "initis", "inites" };

            int[] wnums = new int[] { 4, 5, 3, 4, 6, 6 };

            for (int i = 0; i < Math.Min(len, 6); i++)
            {
                for (int j = 0; j < words.Length; j++)
                {
                    char wj = words[j][5 - i];

                    if (wj == ' ')
                        continue;

                    if (wj== s[end - i])
                        wnums[j]--;

                    if (wnums[j] == 0)
                    {
                        sx = (j % 2);
                        return (j / 2);
                    }
                }
            }

            return -1;
        }

        void Solve()
        {
            io.Print(ReSolve() ? "YES" : "NO");
        }

        private bool ReSolve()
        {
            string predl = io.NextLine();

            if (predl.Length < 3)
                return false;

            int s = 0;
            int e = predl.IndexOf(" ", s) - 1;

            if (e < 0)
                e = predl.Length - 1;

            int[] res = new int[3];

            int p = 0;
            int ps, psx = -1;

            while (true)
            {
                int xres = CheckWord(predl, s, e, out ps);

                if (psx < 0)
                    psx = ps;

                if (psx != ps)
                    return false;

                if (xres < p)
                    return false;

                p = xres;

                res[xres]++;

                if ((res[2] > 0 && res[1] == 0) || res[1] > 1)
                    return false;

                s = e + 2;

                if (s >= predl.Length)
                    break;

                e = predl.IndexOf(" ", s) - 1;

                if (e < 0)
                    e = predl.Length - 1;

            }

            bool bres =  (res[1] > 0) || (res[0] + res[1] + res[2]  == 1);

            if (!bres && predl.Length > 256)
                io.PrintLine("{0}:{1}:{2}", res[0] , res[1] , res[2]);

            return bres;
        }

    }
}


using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Globalization;

namespace Task
{
    #region MyIo

    class MyIo : IDisposable
    {
        TextReader inputStream;
        TextWriter outputStream = Console.Out;

        string[] tokens;
        int pointer;

        public MyIo(TextReader inputStream)
        {
            this.inputStream = inputStream;
        }

        public string NextLine()
        {
            try
            {
                return inputStream.ReadLine();
            }
            catch (IOException)
            {
                return null;
            }
        }

        public string NextString()
        {
            try
            {
                while (tokens == null || pointer >= tokens.Length)
                {
                    tokens = NextLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                    pointer = 0;
                }
                return tokens[pointer++];
            }
            catch (IOException)
            {
                return null;
            }
        }

        public int NextInt()
        {
            return int.Parse(NextString());
        }

        public long NextLong()
        {
            return long.Parse(NextString());
        }

        public void Print(string format, params object[] args)
        {
            outputStream.Write(string.Format(CultureInfo.InvariantCulture, format, args));
        }

        public void PrintLine(string format, params object[] args)
        {
            Print(format, args);

            outputStream.WriteLine();
        }

        public void Print<T>(T o)
        {
            outputStream.Write(o);
        }

        public void PrintLine<T>(T o)
        {
            outputStream.WriteLine(o);
        }

        public void Close()
        {
            inputStream.Close();
            outputStream.Close();
        }

        void IDisposable.Dispose()
        {
            Close();
        }
    }
    #endregion

    class Program
    {
        #region Program
        MyIo io;

        public Program(MyIo io)
        {
            this.io = io;
        }

        static void Main(string[] args)
        {
#if  LOCAL_TEST
            using (MyIo io = new MyIo(new StreamReader("input.txt")))
#else
                using (MyIo io = new MyIo(System.Console.In))
#endif

            {
                new Program(io)
                    .Solve();

#if  LOCAL_TEST
                Console.ReadLine();
#endif
            }
        }

        #endregion

        public int CheckWord(string s, int start, int end, out int sx)
        {
            int len = end - start + 1;

            sx = -1;

            if (len < 3)
                return -1;

            string[] words = new string[] { "  lios", " liala", "   etr", "  etra", "initis", "inites" };

            int[] wnums = new int[] { 4, 5, 3, 4, 6, 6 };

            for (int i = 0; i < Math.Min(len, 6); i++)
            {
                for (int j = 0; j < words.Length; j++)
                {
                    char wj = words[j][5 - i];

                    if (wj == ' ')
                        continue;

                    if (wj== s[end - i])
                        wnums[j]--;

                    if (wnums[j] == 0)
                    {
                        sx = (j % 2);
                        return (j / 2);
                    }
                }
            }

            return -1;
        }

        void Solve()
        {
            io.Print(ReSolve() ? "YES" : "NO");
        }

        private bool ReSolve()
        {
            string predl = io.NextLine();

            if (predl.Length < 3)
                return false;

            int s = 0;
            int e = predl.IndexOf(" ", s) - 1;

            if (e < 0)
                e = predl.Length - 1;

            int[] res = new int[3];

            int p = 0;
            int ps, psx = -1;

            while (true)
            {
                int xres = CheckWord(predl, s, e, out ps);

                if (psx < 0)
                    psx = ps;

                if (psx != ps)
                    return false;

                if (xres < p)
                    return false;

                p = xres;

                res[xres]++;

                if ((res[2] > 0 && res[1] == 0) || res[1] > 1)
                {

                    if (predl.Length > 256)
                        io.PrintLine("{0}:{1}:{2}", res[0], res[1], res[2]);

                    return false;
                }

                s = e + 2;

                if (s >= predl.Length)
                    break;

                e = predl.IndexOf(" ", s) - 1;

                if (e < 0)
                    e = predl.Length - 1;

            }

            bool bres =  (res[1] > 0) || (res[0] + res[1] + res[2]  == 1);

            return bres;
        }

    }
}


using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Globalization;

namespace Task
{
    #region MyIo

    class MyIo : IDisposable
    {
        TextReader inputStream;
        TextWriter outputStream = Console.Out;

        string[] tokens;
        int pointer;

        public MyIo(TextReader inputStream)
        {
            this.inputStream = inputStream;
        }

        public string NextLine()
        {
            try
            {
                return inputStream.ReadLine();
            }
            catch (IOException)
            {
                return null;
            }
        }

        public string NextString()
        {
            try
            {
                while (tokens == null || pointer >= tokens.Length)
                {
                    tokens = NextLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                    pointer = 0;
                }
                return tokens[pointer++];
            }
            catch (IOException)
            {
                return null;
            }
        }

        public int NextInt()
        {
            return int.Parse(NextString());
        }

        public long NextLong()
        {
            return long.Parse(NextString());
        }

        public void Print(string format, params object[] args)
        {
            outputStream.Write(string.Format(CultureInfo.InvariantCulture, format, args));
        }

        public void PrintLine(string format, params object[] args)
        {
            Print(format, args);

            outputStream.WriteLine();
        }

        public void Print<T>(T o)
        {
            outputStream.Write(o);
        }

        public void PrintLine<T>(T o)
        {
            outputStream.WriteLine(o);
        }

        public void Close()
        {
            inputStream.Close();
            outputStream.Close();
        }

        void IDisposable.Dispose()
        {
            Close();
        }
    }
    #endregion

    class Program
    {
        #region Program
        MyIo io;

        public Program(MyIo io)
        {
            this.io = io;
        }

        static void Main(string[] args)
        {
#if  LOCAL_TEST
            using (MyIo io = new MyIo(new StreamReader("input.txt")))
#else
                using (MyIo io = new MyIo(System.Console.In))
#endif

            {
                new Program(io)
                    .Solve();

#if  LOCAL_TEST
                Console.ReadLine();
#endif
            }
        }

        #endregion

        public int CheckWord(string s, int start, int end, out int sx)
        {
            int len = end - start + 1;

            sx = -1;

            if (len < 3)
                return -1;

            string[] words = new string[] { "  lios", " liala", "   etr", "  etra", "initis", "inites" };

            int[] wnums = new int[] { 4, 5, 3, 4, 6, 6 };

            for (int i = 0; i < Math.Min(len, 6); i++)
            {
                for (int j = 0; j < words.Length; j++)
                {
                    char wj = words[j][5 - i];

                    if (wj == ' ')
                        continue;

                    if (wj== s[end - i])
                        wnums[j]--;

                    if (wnums[j] == 0)
                    {
                        sx = (j % 2);
                        return (j / 2);
                    }
                }
            }

            return -1;
        }

        void Solve()
        {
            io.Print(ReSolve() ? "YES" : "NO");
        }

        private bool ReSolve()
        {
            string predl = io.NextLine();

            if (predl.Length < 3)
                return false;

            int s = 0;
            int e = predl.IndexOf(" ", s) - 1;

            if (e < 0)
                e = predl.Length - 1;

            int[] res = new int[3];

            int p = 0;
            int ps, psx = -1;

            while (true)
            {
                int xres = CheckWord(predl, s, e, out ps);

                if (psx < 0)
                    psx = ps;

                if (psx != ps)
                    return false;

                if (xres < p)
                    return false;

                p = xres;

                res[xres]++;

                if ((res[2] > 0 && res[1] == 0) || res[1] > 1)
                    return false;

                s = e + 2;

                if (s >= predl.Length)
                    break;

                e = predl.IndexOf(" ", s) - 1;

                if (e < 0)
                    e = predl.Length - 1;
            }

            return (res[1] > 0) || (res[0] + res[1] + res[2]  == 1);
        }

    }
}


using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Globalization;

namespace Task
{
    #region MyIo

    class MyIo : IDisposable
    {
        TextReader inputStream;
        TextWriter outputStream = Console.Out;

        string[] tokens;
        int pointer;

        public MyIo(TextReader inputStream)
        {
            this.inputStream = inputStream;
        }

        public string NextLine()
        {
            try
            {
                return inputStream.ReadLine();
            }
            catch (IOException)
            {
                return null;
            }
        }

        public string NextString()
        {
            try
            {
                while (tokens == null || pointer >= tokens.Length)
                {
                    tokens = NextLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                    pointer = 0;
                }
                return tokens[pointer++];
            }
            catch (IOException)
            {
                return null;
            }
        }

        public int NextInt()
        {
            return int.Parse(NextString());
        }

        public long NextLong()
        {
            return long.Parse(NextString());
        }

        public void Print(string format, params object[] args)
        {
            outputStream.Write(string.Format(CultureInfo.InvariantCulture, format, args));
        }

        public void PrintLine(string format, params object[] args)
        {
            Print(format, args);

            outputStream.WriteLine();
        }

        public void Print<T>(T o)
        {
            outputStream.Write(o);
        }

        public void PrintLine<T>(T o)
        {
            outputStream.WriteLine(o);
        }

        public void Close()
        {
            inputStream.Close();
            outputStream.Close();
        }

        void IDisposable.Dispose()
        {
            Close();
        }
    }
    #endregion

    class Program
    {
        #region Program
        MyIo io;

        public Program(MyIo io)
        {
            this.io = io;
        }

        static void Main(string[] args)
        {
#if  LOCAL_TEST
            using (MyIo io = new MyIo(new StreamReader("input.txt")))
#else
                using (MyIo io = new MyIo(System.Console.In))
#endif

            {
                new Program(io)
                    .Solve();

#if  LOCAL_TEST
                Console.ReadLine();
#endif
            }
        }

        #endregion

        public int CheckWord(string s, int start, int end, out int sx)
        {
            int len = end - start + 1;

            sx = -1;

            if (len < 3)
                return -1;

            string[] words = new string[] { "  lios", " liala", "   etr", "  etra", "initis", "inites" };

            int[] wnums = new int[] { 4, 5, 3, 4, 6, 6 };

            for (int i = 0; i < Math.Min(len, 6); i++)
            {
                for (int j = 0; j < words.Length; j++)
                {
                    char wj = words[j][5 - i];

                    if (wj == ' ')
                        continue;

                    if (wj== s[end - i])
                        wnums[j]--;

                    if (wnums[j] == 0)
                    {
                        sx = (j % 2);
                        return (j / 2);
                    }
                }
            }

            return -1;
        }

        void Solve()
        {
            io.Print(ReSolve() ? "YES" : "NO");
        }

        private bool ReSolve()
        {
            string predl = io.NextLine();

            if (predl.Length < 3)
                return false;

            int s = 0;
            int e = predl.IndexOf(" ", s) - 1;

            if (e < 0)
                e = predl.Length - 1;

            int[] res = new int[3];

            int p = 0;
            int ps, psx = -1;

            while (true)
            {
                int xres = CheckWord(predl, s, e, out ps);

                if (psx < 0)
                    psx = ps;

                if (psx != ps)
                    return false;

                if (xres < p)
                    return false;

                p = xres;

                res[xres]++;

                if ((res[0] + res[1] + res[2] > 1 && res[1] == 0) || res[1] > 1)
                    return false;

                s = e + 2;

                if (s >= predl.Length)
                    break;

                e = predl.IndexOf(" ", s) - 1;

                if (e < 0)
                    e = predl.Length - 1;

            }

            return (res[1] > 0) || (res[0] + res[1] + res[2]  == 1);
        }

    }
}


using System;
using System.Collections.Generic;

public class Fffuuuu {

    String[] suff = { "lios", "liala", "etr", "etra", "initis", "inites" };

    Int32 Id(String str) {
        return Array.FindIndex(suff, (sf) => str.EndsWith(sf));
    }

    Boolean Check(String[] tok) {
        if (!Array.TrueForAll(tok, (t) => Id(t) >= 0 && Id(t) % 2 == Id(tok[0]) % 2)) {
            return false;
        }
        if (tok.Length == 1) {
            return true;
        }
        Int32 i, p = Array.FindIndex(tok, (t) => Id(t) / 2 == 1);
        if (p < 0) {
            return false;
        }
        for (i = 0; i < p; ++i) {
            if (Id(tok[i]) > 1) {
                return false;
            }
        }
        for (i = p + 1; i < tok.Length; ++i) {
            if (Id(tok[i]) < 4) {
                return false;
            }
        }
        return true;
    }

    public Fffuuuu() {
        Console.WriteLine(Check(Console.ReadLine().Split(' ')) ? "YES" : "NO");
    }

    public static void Main() {
#if DEBUG
        Console.SetIn(new System.IO.StreamReader("in.txt"));
#endif
        new Fffuuuu();
    }

}


using System;

class Fffuuuu {

    Boolean MG(String str) {
        return str.EndsWith("lios") || str.EndsWith("etr") || str.EndsWith("initis");
    }

    Boolean Pril(String str) {
        return str.EndsWith("lios") || str.EndsWith("liala");
    }

    Boolean Sush(String str) {
        return str.EndsWith("etr") || str.EndsWith("etra");
    }

    Boolean Glag(String str) {
        return str.EndsWith("initis") || str.EndsWith("inites");
    }

    Boolean Check(String text) {
        String[] tok = text.Split(' ');
        if (tok.Length == 1) {
            return true;
        }

        Boolean mg = MG(tok[0]);
        foreach (String s in tok) {
            if (MG(s) != mg) {
                return false;
            }
        }
        Int32 j = Array.FindIndex(tok, Sush);
        if (j < 0) {
            return false;
        }
        for (Int32 i = 0; i < j; ++i) {
            if (!Pril(tok[i]) || MG(tok[i]) != mg) {
                return false;
            }
        }
        for (Int32 i = j + 1; i < tok.Length; ++i) {
            if (!Glag(tok[i]) || MG(tok[i]) != mg) {
                return false;
            }
        }
        return true;
    }

    public Fffuuuu() {
        Console.WriteLine(Check(Console.ReadLine()) ? "YES" : "NO");
    }

    public static void Main() {
#if DEBUG
        Console.SetIn(new System.IO.StreamReader("in.txt"));
#endif
        new Fffuuuu();
    }

}