Haiku is a genre of Japanese traditional poetry.

A haiku poem consists of 17 syllables split into three phrases, containing 5, 7 and 5 syllables correspondingly (the first phrase should contain exactly 5 syllables, the second phrase should contain exactly 7 syllables, and the third phrase should contain exactly 5 syllables). A haiku masterpiece contains a description of a moment in those three phrases. Every word is important in a small poem, which is why haiku are rich with symbols. Each word has a special meaning, a special role. The main principle of haiku is to say much using a few words.

To simplify the matter, in the given problem we will consider that the number of syllable in the phrase is equal to the number of vowel letters there. Only the following letters are regarded as vowel letters: "a", "e", "i", "o" and "u".

Three phases from a certain poem are given. Determine whether it is haiku or not.

Input

The input data consists of three lines. The length of each line is between 1 and 100, inclusive. The i-th line contains the i-th phrase of the poem. Each phrase consists of one or more words, which are separated by one or more spaces. A word is a non-empty sequence of lowercase Latin letters. Leading and/or trailing spaces in phrases are allowed. Every phrase has at least one non-space character. See the example for clarification.

Output

Print "YES" (without the quotes) if the poem is a haiku. Otherwise, print "NO" (also without the quotes).

Examples

Input

on  codeforces 
beta round is running
   a rustling of keys 


Output

YES

Input

how many gallons
of edo s rain did you drink
                                cuckoo


Output

NO

Difficulty: EASY

Solutions:
g = ['a', 'e', 'i', 'o', 'u']
ans = [0] * 3
h = [5, 7, 5]
for i in range(3):
	s = input()
	for j in s:
		if j in g:
			ans[i] += 1
if ans == h:
	print('YES')
else:
	print('NO')


x = 0
l1 = list(input())
if l1.count('a') + l1.count('e') + l1.count('i') + l1.count('o') + l1.count('u') != 5:
	x = 1
l2 = list(input())
if l2.count('a') + l2.count('e') + l2.count('i') + l2.count('o') + l2.count('u') != 7:
	x = 1
l3 = list(input())
if l3.count('a') + l3.count('e') + l3.count('i') + l3.count('o') + l3.count('u') != 5:
	x = 1
if x == 0:
	print('YES')
if x == 1:
	print('NO')


l = [5, 7, 5]
ans = 'YES'
for i in range(3):
	n = list(input())
	for j in n:
		if j == 'a' or j == 'e' or j == 'i' or (j == 'o') or (j == 'u'):
			l[i] -= 1
	if l[i] != 0:
		ans = 'NO'
		break
print(ans)


__author__ = 'asmn'
print('YES' if tuple((len(list(filter(lambda c: True if c in {'a', 'e', 'i', 'o', 'u'} else False, input()))) for i in range(3))) == (5, 7, 5) else 'NO')


flag = 0
count = 0
str = input()
for i in str:
	if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
		count = count + 1
if count != 5:
	flag = 1
if flag == 0:
	str = input()
	for i in str:
		if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
			count = count + 1
	if count != 12:
		flag = 1
	if flag == 0:
		str = input()
		for i in str:
			if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
				count += 1
		if count != 17:
			flag = 1
if flag == 0:
	print('YES')
else:
	print('NO')


I = input
F = lambda x: sum((x.count(i) for i in 'aeiou'))
s = F(I())
p = F(I())
print(['NO', 'YES'][p - 2 == s == F(I()) == 5])


a = input()
b = input()
c = input()
vol = 'aeiou'
x = len([i for i in a if i in vol])
y = len([i for i in b if i in vol])
z = len([i for i in c if i in vol])
print('YES' if x == z == 5 and y == 7 else 'NO')


ans = True
for i in range(3):
	s = input()
	t = s.count('a') + s.count('e') + s.count('i') + s.count('o') + s.count('u')
	if t != [5, 7, 5][i]:
		ans = False
if ans:
	print('YES')
else:
	print('NO')


import sys
(s, t, r) = (input().strip(), input().strip(), input().strip())
vowel = set('aeiou')
s_counter = t_counter = r_counter = 0
for _ in s:
	if _ in vowel:
		s_counter += 1
if s_counter != 5:
	print('NO')
	sys.exit()
for _ in t:
	if _ in vowel:
		t_counter += 1
if t_counter != 7:
	print('NO')
	sys.exit()
for _ in r:
	if _ in vowel:
		r_counter += 1
if r_counter != 5:
	print('NO')
	sys.exit()
print('YES')


s = str(input())
s1 = str(input())
s2 = str(input())
sum = 0
count = 0
f = 0
for i in range(0, len(s), 1):
	if s[i] == 'a' or s[i] == 'e' or s[i] == 'i' or (s[i] == 'o') or (s[i] == 'u'):
		count += 1
for i in range(0, len(s1), 1):
	if s1[i] == 'a' or s1[i] == 'e' or s1[i] == 'i' or (s1[i] == 'o') or (s1[i] == 'u'):
		sum += 1
for i in range(0, len(s2), 1):
	if s2[i] == 'a' or s2[i] == 'e' or s2[i] == 'i' or (s2[i] == 'o') or (s2[i] == 'u'):
		f += 1
if count == 5 and sum == 7 and (f == 5):
	print('YES')
else:
	print('NO')


def f(x):
	if x == 'a' or x == 'e' or x == 'i' or (x == 'o') or (x == 'u'):
		return 1
	else:
		return 0
s1 = [f(n) for n in input()]
s2 = [f(n) for n in input()]
s3 = [f(n) for n in input()]
if sum(s1) == 5 and sum(s2) == 7 and (sum(s3) == 5):
	print('YES')
else:
	print('NO')


p1 = input()
p2 = input()
p3 = input()
p = [p1, p2, p3]
counters = []
for i in range(3):
	count = 0
	for j in range(len(p[i])):
		if p[i][j] in 'aeiou':
			count += 1
	counters.append(count)
if counters[0] == 5 and counters[1] == 7 and (counters[2] == 5):
	print('YES')
else:
	print('NO')


h1 = input()
h2 = input()
h3 = input()

def count(string):
	global ans
	ans = 0
	for i in string:
		if i == 'a':
			ans += 1
	for i in string:
		if i == 'e':
			ans += 1
	for i in string:
		if i == 'i':
			ans += 1
	for i in string:
		if i == 'o':
			ans += 1
	for i in string:
		if i == 'u':
			ans += 1
	return ans
if count(h1) == 5 and count(h2) == 7 and (count(h3) == 5):
	print('YES')
else:
	print('NO')


s1 = input()
s2 = input()
s3 = input()
if s1.count('a') + s1.count('o') + s1.count('e') + s1.count('i') + s1.count('u') == 5 and s2.count('a') + s2.count('o') + s2.count('e') + s2.count('i') + s2.count('u') == 7 and (s3.count('a') + s3.count('o') + s3.count('e') + s3.count('i') + s3.count('u') == 5):
	print('YES')
else:
	print('NO')


from sys import stdin, stdout

def count(s):
	return s.count('i') + s.count('e') + s.count('u') + s.count('a') + s.count('o')
(first, second, third) = (stdin.readline().strip(), stdin.readline().strip(), stdin.readline().strip())
if count(first) == 5 and count(second) == 7 and (count(third) == 5):
	stdout.write('YES')
else:
	stdout.write('NO')


vowel = ['a', 'e', 'i', 'o', 'u']
count = 0
for i in range(3):
	count = 0
	a = input()
	if i == 0 or i == 2:
		for j in vowel:
			count += a.count(j)
		if count != 5:
			print('NO')
			exit()
	else:
		for j in vowel:
			count += a.count(j)
		if count != 7:
			print('NO')
			exit()
print('YES')


import sys
from functools import reduce
from collections import Counter
import time
import datetime
from math import sqrt, gcd

def ip():
	return int(sys.stdin.readline())

def sip():
	return sys.stdin.readline()

def mip():
	return map(int, sys.stdin.readline().split())

def mips():
	return map(str, sys.stdin.readline().split())

def lip():
	return list(map(int, sys.stdin.readline().split()))

def matip(n, m):
	lst = []
	for i in range(n):
		arr = lip()
		lst.insert(i, arr)
	return lst

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def minJumps(arr, n):
	jumps = [0 for i in range(n)]
	if n == 0 or arr[0] == 0:
		return float('inf')
	jumps[0] = 0
	for i in range(1, n):
		jumps[i] = float('inf')
		for j in range(i):
			if i <= j + arr[j] and jumps[j] != float('inf'):
				jumps[i] = min(jumps[i], jumps[j] + 1)
				break
	return jumps[n - 1]

def dic(arr):
	return Counter(arr)

def check_prime(n):
	if n < 2:
		return False
	for i in range(2, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
first = sip()
second = sip()
third = sip()
lst = ['a', 'e', 'i', 'o', 'u']
flag = 0
count = 0
for item in first:
	if item in lst:
		count += 1
if count != 5:
	flag = 1
count = 0
for item in second:
	if item in lst:
		count += 1
if count != 7:
	flag = 1
count = 0
for item in third:
	if item in lst:
		count += 1
if count != 5:
	flag = 1
if flag == 1:
	print('NO')
else:
	print('YES')


a = [5, 7, 5]
banderita = True
lista = []
for i in range(0, 3):
	lista.append(input())
for j in range(0, len(lista)):
	t = 0
	for k in range(0, len(lista[j])):
		if lista[j][k] == 'a' or lista[j][k] == 'e' or lista[j][k] == 'i' or (lista[j][k] == 'o') or (lista[j][k] == 'u'):
			t += 1
	if t != a[j]:
		banderita = 1 == 2
if banderita:
	print('YES')
else:
	print('NO')


def q78a():
	a = input()
	b = input()
	c = input()
	if q78a_count_vowels(a) == 5 and q78a_count_vowels(b) == 7 and (q78a_count_vowels(c) == 5):
		print('YES')
	else:
		print('NO')

def q78a_count_vowels(string):
	vowels = ['a', 'e', 'i', 'o', 'u']
	count = 0
	for char in string:
		if char in vowels:
			count += 1
	return count
q78a()


import sys
haiku = sys.stdin.read()
haiku_syllables = haiku.split('\n')
haiku_syllables = haiku_syllables[:len(haiku_syllables) - 1]
result = []
if len(haiku_syllables) != 3:
	print('NO')
else:
	for i in haiku_syllables:
		count = 0
		for j in i.strip():
			if j in ['a', 'e', 'i', 'o', 'u']:
				count += 1
		result.append(count)
	if result[0] == 5 and result[1] == 7 and (result[2] == 5):
		print('YES')
	else:
		print('NO')


import re
ok = True
vals = [5, 7, 5]
for i in range(0, 3):
	ok = ok and re.sub('[aeuio]', '.', input()).count('.') == vals[i]
print('YES' if ok else 'NO')


import re
s1 = input()
s2 = input()
s3 = input()
if len(re.findall('[a,e,i,o,u]{1}', s1)) == 5 and len(re.findall('[a,e,i,o,u]{1}', s2)) == 7 and (len(re.findall('[a,e,i,o,u]{1}', s3)) == 5):
	print('YES')
else:
	print('NO')


v = 'aeiou'

def countVowels(s):
	res = 0
	for i in v:
		res += s.count(i)
	return res
s1 = str(input())
s2 = str(input())
s3 = str(input())
c1 = countVowels(s1)
c2 = countVowels(s2)
c3 = countVowels(s3)
if c1 == 5 and c2 == 7 and (c3 == 5):
	print('YES')
else:
	print('NO')


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	boins = ['a', 'i', 'u', 'e', 'o']
	a = S()
	b = S()
	c = S()
	c1 = c2 = c3 = 0
	for x in a:
		if x in boins:
			c1 += 1
	for x in b:
		if x in boins:
			c2 += 1
	for x in c:
		if x in boins:
			c3 += 1
	if c1 == 5 and c2 == 7 and (c3 == 5):
		return 'YES'
	return 'NO'
print(main())


import re

def f(s):
	return len(re.findall('(a|e|i|o|u)', s))
if [5, 7, 5] == [f(input()), f(input()), f(input())]:
	print('YES')
else:
	print('NO')


l = []
for i in range(3):
	s = input()
	s = s.strip()
	l.append(s)
flag = 1
for j in range(3):
	a = l[j].count('a')
	e = l[j].count('e')
	i = l[j].count('i')
	o = l[j].count('o')
	u = l[j].count('u')
	summ = a + e + i + o + u
	if j == 0 and summ == 5:
		continue
	elif j == 1 and summ == 7:
		continue
	elif j == 2 and summ == 5:
		continue
	else:
		flag = 0
		break
if flag:
	print('YES')
else:
	print('NO')


a = input()
b = input()
c = input()
x = 0
y = 0
z = 0
for i in a:
	if i in 'aeiou':
		z += 1
for j in b:
	if j in 'aeiou':
		y += 1
for k in c:
	if k in 'aeiou':
		x += 1
if x == 5 and y == 7 and (z == 5):
	print('YES')
else:
	print('NO')


(a, b, c) = ([i for i in input() if i in 'aeiou'], [i for i in input() if i in 'aeiou'], [i for i in input() if i in 'aeiou'])
print('YES' if len(a) == 5 and len(b) == 7 and (len(c) == 5) else 'NO')


s1 = input()
s2 = input()
s3 = input()
c0 = 0
c1 = 0
c2 = 0
l = ['a', 'i', 'o', 'u', 'e']
for i in l:
	for j in s1:
		if i == j:
			c0 += 1
if c0 != 5:
	print('NO')
	exit()
for i in l:
	for j in s2:
		if i == j:
			c1 += 1
if c1 != 7:
	print('NO')
	exit()
for i in l:
	for j in s3:
		if i == j:
			c2 += 1
if c2 != 5:
	print('NO')
	exit()
else:
	print('YES')


v = 'aeiou'
s1 = input()
s2 = input()
s3 = input()
syl1 = sum((i in v for i in s1))
syl2 = sum((i in v for i in s2))
syl3 = sum((i in v for i in s3))
if syl1 == 5 and syl2 == 7 and (syl3 == 5):
	print('YES')
else:
	print('NO')


samoglasnici = ['a', 'e', 'i', 'o', 'u']
ult = 0
for i in range(0, 3):
	s = input()
	br = 0
	for j in range(len(s)):
		if s[j] in samoglasnici:
			br += 1
	if i == 0 or i == 2:
		if br == 5:
			ult += 1
	if i == 1:
		if br == 7:
			ult += 1
if ult == 3:
	print('YES')
else:
	print('NO')


s1 = input()
s2 = input()
s3 = input()
(count1, count2, count3) = (0, 0, 0)
for i in s1:
	if i in ['a', 'e', 'i', 'o', 'u']:
		count1 += 1
for i in s2:
	if i in ['a', 'e', 'i', 'o', 'u']:
		count2 += 1
for i in s3:
	if i in ['a', 'e', 'i', 'o', 'u']:
		count3 += 1
if count1 == 5 and count2 == 7 and (count3 == 5):
	print('YES')
else:
	print('NO')


s1 = input()
s2 = input()
s3 = input()
(p1, p2, p3) = (0, 0, 0)
for i in s1:
	if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
		p1 = p1 + 1
for i in s2:
	if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
		p2 = p2 + 1
for i in s3:
	if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
		p3 = p3 + 1
if p1 == 5 and p2 == 7 and (p3 == 5):
	print('YES')
else:
	print('NO')


vocals = ['a', 'e', 'i', 'o', 'u']

def f(x):
	s = 0
	for i in range(5):
		s += x.count(vocals[i])
	return s

def g(s):
	A = []
	for i in range(len(s)):
		A.append(s[i])
	return A
a = input()
b = input()
c = input()
a = g(a)
b = g(b)
c = g(c)
if f(a) == 5 and f(b) == 7 and (f(c) == 5):
	print('YES')
else:
	print('NO')


a = input()
b = input()
c = input()
c1 = 0
c2 = 0
c3 = 0
c1 += a.count('a')
c2 += b.count('a')
c3 += c.count('a')
c1 += a.count('e')
c2 += b.count('e')
c3 += c.count('e')
c1 += a.count('i')
c2 += b.count('i')
c3 += c.count('i')
c1 += a.count('o')
c2 += b.count('o')
c3 += c.count('o')
c1 += a.count('u')
c2 += b.count('u')
c3 += c.count('u')
if c1 == 5 and c2 == 7 and (c3 == 5):
	print('YES')
else:
	print('NO')


import math, fractions
s = ''
for _ in range(3):
	x = str(input())
	s += str(sum([1 for vowel in x if vowel in 'aiueo']))
print('YES' if s == '575' else 'NO')


(a, b, c) = (input(), input(), input())

def cnt(s):
	ans = 0
	for e in s:
		ans += e in 'aeiou'
	return ans
print('YES' if cnt(a) == cnt(c) == 5 and cnt(b) == 7 else 'NO')


def count_vowels():
	s = input()
	vowels = 0
	i = len(s)
	while i:
		i = i - 1
		if s[i] == 'a' or s[i] == 'e' or s[i] == 'i' or (s[i] == 'o') or (s[i] == 'u'):
			vowels = vowels + 1
	return vowels
if count_vowels() == 5 and count_vowels() == 7 and (count_vowels() == 5):
	print('YES')
else:
	print('NO')


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res) % MOD

def comb(n, x):
	(a, b) = (1, 1)
	for i in range(1, x + 1):
		a *= n + 1 - i
		b *= i
	return a // b % MOD

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	if y == 0:
		return 1
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(moves, n):
	val = (moves + 1) // 2
	rem = moves - val
	sol = (val + 1) * (rem + 1)
	return sol < n

def sortSecond(val):
	return val[1]
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
small = 'abcdefghijklmnopqrstuvwxyz'
large = small.upper()
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect
import functools as fnt
from decimal import Decimal

def solve():
	vowels = 'aeiou'
	found = False
	for i in range(3):
		s = string()
		syllables = 0
		for x in s:
			if x in vowels:
				syllables += 1
		if i % 2 == 0 and syllables != 5:
			found = True
			continue
		if i % 2 == 1 and syllables != 7:
			found = True
			continue
	if not found:
		print('YES')
	else:
		print('NO')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = 1
for i in range(t):
	solve()


def solve():
	target = [5, 7, 5]
	ans = 'YES'
	for i in range(3):
		s = input()
		cnt = 0
		for x in s:
			if x in 'aeiou':
				cnt += 1
		if cnt != target[i]:
			ans = 'NO'
	return ans
print(solve())


import sys
import os
from collections import Counter

def changeStdioToFile():
	path = os.path.dirname(os.path.abspath(__file__))
	sys.stdin = open(f'{path}/input.txt', 'r')
	sys.stdout = open(f'{path}/output.txt', 'w')
t = 1
for _ in range(t):
	flag = False
	for i in (5, 7, 5):
		c = Counter(input())
		if sum((c.get(w, 0) for w in 'aeiou')) != i:
			flag = True
	print('YES' if not flag else 'NO')


n = [5, 7, 5]
haiku = True
for i in range(3):
	s = input().strip()
	vowel = sum((1 for i in s if i in 'aeiou'))
	if vowel != n[i]:
		haiku = False
		break
print('YES' if haiku else 'NO')


f = input().strip().split()
s = input().strip().split()
t = input().strip().split()
v = ['a', 'e', 'i', 'o', 'u']
fc = 0
for i in f:
	for j in i:
		if j in v:
			fc += 1
sc = 0
for i in s:
	for j in i:
		if j in v:
			sc += 1
tc = 0
for i in t:
	for j in i:
		if j in v:
			tc += 1
if fc == 5 and sc == 7 and (tc == 5):
	print('YES')
else:
	print('NO')


count = 0
a = input()
b = input()
c = input()
(v1, v2, v3) = (0, 0, 0)
for i in a:
	if i in 'aeiou':
		v1 += 1
for i in b:
	if i in 'aeiou':
		v2 += 1
for i in c:
	if i in 'aeiou':
		v3 += 1
if v1 == 5 and v2 == 7 and (v3 == 5):
	print('YES')
else:
	print('NO')


d = ['a', 'e', 'i', 'u', 'o']
a = input()
if sum((a.count(e) for e in d)) != 5:
	print('NO')
	exit(0)
b = input()
if sum((b.count(e) for e in d)) != 7:
	print('NO')
	exit(0)
c = input()
if sum((c.count(e) for e in d)) != 5:
	print('NO')
	exit(0)
print('YES')


l = ['a', 'e', 'i', 'o', 'u']
t1 = t2 = t3 = 0
s1 = input().strip()
s2 = input().strip()
s3 = input().strip()
for x in s1:
	if x in l:
		t1 += 1
for x in s2:
	if x in l:
		t2 += 1
for x in s3:
	if x in l:
		t3 += 1
if t1 == 5 and t2 == 7 and (t3 == 5):
	print('YES')
else:
	print('NO')


ans = []
for _ in range(3):
	i = input()
	acount = i.count('a')
	ecount = i.count('e')
	icount = i.count('i')
	ocount = i.count('o')
	ucount = i.count('u')
	ans.append(acount + ecount + icount + ocount + ucount)
if ans == [5, 7, 5]:
	print('YES')
else:
	print('NO')


p = 'aeiou'
a = [input(), input(), input()]
pp = []
for i in range(3):
	t = 0
	for j in a[i]:
		if j in p:
			t += 1
	pp.append(t)
if pp == [5, 7, 5]:
	print('YES')
else:
	print('NO')


s1 = input()
s2 = input()
s3 = input()
a = b = c = 0
for i in s1:
	if i in 'aeiou':
		a += 1
for i in s2:
	if i in 'aeiou':
		b += 1
for i in s3:
	if i in 'aeiou':
		c += 1
if a == 5 and b == 7 and (c == 5):
	print('YES')
else:
	print('NO')


l = [0] * 3
for i in range(3):
	n = input()
	l[i] = sum((n.count(x) for x in 'aeiou'))
(a, b, c) = l
print('YES' if a == 5 and b == 7 and (c == 5) else 'NO')


(s1, s2, s3) = (input(), input(), input())
cnt1 = 0
cnt2 = 0
cnt3 = 0
string = 'aeiou'
for i in range(len(s1)):
	if s1[i] in string:
		cnt1 += 1
for i in range(len(s2)):
	if s2[i] in string:
		cnt2 += 1
for i in range(len(s3)):
	if s3[i] in string:
		cnt3 += 1
if cnt1 == 5 and cnt3 == 5 and (cnt2 == 7):
	print('YES')
else:
	print('NO')


haiku = []
counter = [0, 0, 0]
vowels = ['a', 'e', 'i', 'o', 'u']
for i in range(3):
	haiku.append(input().split())
for i in range(3):
	for j in list(''.join(haiku[i])):
		if j in vowels:
			counter[i] += 1
if counter == [5, 7, 5]:
	print('YES')
else:
	print('NO')


a = input()
b = input()
c = input()
a = sum((a.count(x) for x in 'aeiou'))
b = sum((b.count(x) for x in 'aeiou'))
c = sum((c.count(x) for x in 'aeiou'))
print('YES' if a == 5 and b == 7 and (c == 5) else 'NO')


l = []
for _ in range(3):
	l.append(input())
for i in range(3):
	c = 0
	if i == 1:
		for j in l[i]:
			if j == 'a' or j == 'e' or j == 'i' or (j == 'o') or (j == 'u'):
				c += 1
		if c != 7:
			print('NO')
			break
	else:
		for j in l[i]:
			if j == 'a' or j == 'e' or j == 'i' or (j == 'o') or (j == 'u'):
				c += 1
		if c != 5:
			print('NO')
			break
else:
	print('YES')


def ishaiku(s1, s2, s3):
	cnt_s1 = 0
	cnt_s2 = 0
	cnt_s3 = 0
	for i in s1:
		if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
			cnt_s1 += 1
	for i in s2:
		if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
			cnt_s2 += 1
	for i in s3:
		if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
			cnt_s3 += 1
	if cnt_s1 == 5 and cnt_s2 == 7 and (cnt_s3 == 5):
		return True
	return False

def main():
	s1 = str(input()).replace(' ', '')
	s2 = str(input()).replace(' ', '')
	s3 = str(input()).replace(' ', '')
	if ishaiku(s1, s2, s3):
		print('YES')
	else:
		print('NO')
main()


def main():
	res = True
	for n in (5, 7, 5):
		res &= sum((c in ('a', 'e', 'i', 'o', 'u') for c in input())) == n
	print(('NO', 'YES')[res])
main()


str1 = input()
str2 = input()
str3 = input()
(cnt1, cnt2, cnt3) = (0, 0, 0)
for i in str1:
	if i in 'aeiou':
		cnt1 += 1
for i in str2:
	if i in 'aeiou':
		cnt2 += 1
for i in str3:
	if i in 'aeiou':
		cnt3 += 1
if cnt1 == 5 and cnt2 == 7 and (cnt3 == 5):
	print('YES')
else:
	print('NO')


import re
pattern = re.compile('[a,e,i,o,u]')
a = len(pattern.findall(str(input())))
b = len(pattern.findall(str(input())))
c = len(pattern.findall(str(input())))
print('YES' if a == 5 and b == 7 and (c == 5) else 'NO')


x = []
for i in range(3):
	s = input()
	c = 0
	for j in s:
		if j == 'a' or j == 'e' or j == 'i' or (j == 'o') or (j == 'u'):
			c += 1
	x.append(c)
if x[0] == 5 and x[1] == 7 and (x[2] == 5):
	print('YES')
else:
	print('NO')


row = input()
row1 = input()
row2 = input()
vowel = ['a', 'e', 'u', 'i', 'o']
numf = 0
nums = 0
numt = 0
for x in row.split():
	for j in x:
		if j in vowel:
			numf = numf + 1
if numf == 5:
	for x in row1.split():
		for j in x:
			if j in vowel:
				nums = nums + 1
	if nums == 7:
		for x in row2.split():
			for j in x:
				if j in vowel:
					numt = numt + 1
		if numt == 5:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
else:
	print('NO')


slog = ['a', 'e', 'i', 'o', 'u']
a = list(map(str, input().split()))
b = list(map(str, input().split()))
c = list(map(str, input().split()))
A = ''.join(a)
B = ''.join(b)
C = ''.join(c)
(cnt1, cnt2, cnt3) = (0, 0, 0)
for i in range(len(A)):
	for j in range(len(slog)):
		if A[i] == slog[j]:
			cnt1 += 1
for i in range(len(B)):
	for j in range(len(slog)):
		if B[i] == slog[j]:
			cnt2 += 1
for i in range(len(C)):
	for j in range(len(slog)):
		if C[i] == slog[j]:
			cnt3 += 1
if cnt1 == 5 and cnt2 == 7 and (cnt3 == 5):
	print('YES')
else:
	print('NO')


S = [str(input()) for _ in range(3)]
C = [0] * 3
B = set(['a', 'e', 'i', 'o', 'u'])
for i in range(3):
	s = S[i]
	cnt = 0
	for j in range(len(s)):
		if s[j] in B:
			cnt += 1
	C[i] = cnt
if C == [5, 7, 5]:
	print('YES')
else:
	print('NO')


o = input().replace(' ', '')
t = input().replace(' ', '')
e = input().replace(' ', '')

def vo(n):
	k = ['a', 'e', 'i', 'o', 'u']
	v = 0
	for i in n:
		if i in k:
			v += 1
	return v
if vo(o) == 5 and vo(t) == 7 and (vo(e) == 5):
	print('YES')
else:
	print('NO')


line1 = input()
line2 = input()
line3 = input()
s1 = line1.count('a') + line1.count('e') + line1.count('i') + line1.count('o') + line1.count('u')
s2 = line2.count('a') + line2.count('e') + line2.count('i') + line2.count('o') + line2.count('u')
s3 = line3.count('a') + line3.count('e') + line3.count('i') + line3.count('o') + line3.count('u')
if s1 != 5 or s2 != 7 or s3 != 5:
	print('NO')
else:
	print('YES')


vowels = set(['a', 'e', 'i', 'o', 'u'])

def occ(string, chars):
	cnt = 0
	for char in string:
		if char in chars:
			cnt += 1
	return cnt
s = [input() for i in range(3)]
if [occ(s[i], vowels) for i in range(3)] == [5, 7, 5]:
	print('YES')
else:
	print('NO')


a = list(input())
b = list(input())
c = list(input())
x = []
y = 0
for i in range(len(a)):
	if a[i] == 'a' or a[i] == 'e' or a[i] == 'i' or (a[i] == 'o') or (a[i] == 'u'):
		y += 1
if y == 5:
	x.append('YES')
else:
	x.append('NO')
y = 0
for i in range(len(b)):
	if b[i] == 'a' or b[i] == 'e' or b[i] == 'i' or (b[i] == 'o') or (b[i] == 'u'):
		y += 1
if y == 7:
	x.append('YES')
else:
	x.append('NO')
y = 0
for i in range(len(c)):
	if c[i] == 'a' or c[i] == 'e' or c[i] == 'i' or (c[i] == 'o') or (c[i] == 'u'):
		y += 1
if y == 5:
	x.append('YES')
else:
	x.append('NO')
for i in x:
	if i == 'NO':
		j = 'NO'
		break
	else:
		j = 'YES'
if j == 'YES':
	print('YES')
else:
	print('NO')


is_haiku = True
for x in range(0, 3):
	phrase = input()
	phrase = phrase.strip()
	vowel_cnt = phrase.count('a') + phrase.count('e') + phrase.count('i') + phrase.count('o') + phrase.count('u')
	if x == 0 and vowel_cnt != 5 or (x == 1 and vowel_cnt != 7) or (x == 2 and vowel_cnt != 5):
		is_haiku = False
		break
if is_haiku:
	print('YES')
else:
	print('NO')


from collections import Counter

def check(x):
	c = Counter(''.join(x))
	return c.get('a', 0) + c.get('e', 0) + c.get('i', 0) + c.get('o', 0) + c.get('u', 0)
(na, nb, nc) = (input().strip().split(' '), input().strip().split(' '), input().strip().split(' '))
print('YES') if check(na) == 5 and check(nb) == 7 and (check(nc) == 5) else print('NO')


def countVowel(x):
	cnt = 0
	for i in x:
		if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
			cnt += 1
	return cnt
a = input()
b = input()
c = input().strip()
flag = False
if countVowel(a) == 5 and countVowel(b) == 7 and (countVowel(c) == 5):
	flag = True
else:
	flag = False
if flag:
	print('YES')
else:
	print('NO')


a = input()
b = input()
c = input()
d = ['a', 'e', 'i', 'o', 'u']
p = 0
q = 0
r = 0
for i in range(len(a)):
	if a[i] in d:
		p = p + 1
for i in range(len(b)):
	if b[i] in d:
		q += 1
for i in range(len(c)):
	if c[i] in d:
		r += 1
if p == 5 and q == 7 and (r == 5):
	print('YES')
else:
	print('NO')


a = input()
b = input()
c = input()

def isVowel(c):
	return c == 'a' or c == 'e' or c == 'i' or (c == 'o') or (c == 'u')

def vowelNo(s):
	c = 0
	for i in s:
		if isVowel(i):
			c += 1
	return c
if vowelNo(a) == 5 and vowelNo(b) == 7 and (vowelNo(c) == 5):
	print('YES')
else:
	print('NO')


b = []
for i in range(3):
	l = input()
	l = l.replace(' ', '')
	b.append(l)
c = 0
d = 0
f = 0
a = 'aeiou'
for i in range(len(b)):
	for j in range(len(b[i])):
		if b[i][j] in a and i == 0:
			c = c + 1
		elif b[i][j] in a and i == 1:
			d = d + 1
		elif b[i][j] in a and i == 2:
			f = f + 1
		else:
			continue
if c == 5 and d == 7:
	if f == 5:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


for i in range(3):
	if sum((j in 'aeiou' for j in input())) != -abs(i - 1) * 2 + 7:
		print('NO')
		exit(0)
print('YES')


z = 0
for i in range(3):
	count = 0
	s = input()
	for x in s:
		if x == 'a' or x == 'e' or x == 'i' or (x == 'o') or (x == 'u'):
			count += 1
		else:
			continue
	if i == 1:
		if count == 7:
			continue
		else:
			z = 1
	elif count == 5:
		continue
	else:
		z = 1
if z == 1:
	print('NO')
else:
	print('YES')


l1 = input()
l2 = input()
l3 = input()
c1 = 0
c2 = 0
c3 = 0
for i in l1:
	if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
		c1 = c1 + 1
for i in l2:
	if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
		c2 = c2 + 1
for i in l3:
	if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
		c3 = c3 + 1
if c1 == 5 and c2 == 7 and (c3 == 5):
	print('YES')
else:
	print('NO')


a = list(input())
b = list(input())
c = list(input())
v = ['a', 'e', 'i', 'o', 'u']
k = 0
flag = 0
for i in range(len(a)):
	if a[i] in v:
		k += 1
if k != 5:
	flag = 1
k = 0
for i in range(len(b)):
	if b[i] in v:
		k += 1
if k != 7:
	flag = 1
k = 0
for i in range(len(c)):
	if c[i] in v:
		k += 1
if k != 5:
	flag = 1
if flag == 1:
	print('NO')
else:
	print('YES')


a = []
b = []
for i in range(3):
	a += [input()]
for i in a:
	b += [len([j for j in i if j in 'aeiou'])]
if b == [5, 7, 5]:
	print('YES')
else:
	print('NO')


def count_syllables(s):
	vowels = set(['a', 'o', 'i', 'e', 'u'])
	res = 0
	for ch in s:
		if ch in vowels:
			res += 1
	return res
nlines = 3
lines = []
csyll = []
for i in range(0, nlines):
	lines.append(input().strip())
for l in lines:
	csyll.append(count_syllables(l))
if csyll[0] == 5 and csyll[1] == 7 and (csyll[2] == 5):
	print('YES\n')
else:
	print('NO\n')


c1 = 0
c2 = 0
c3 = 0
s1 = input().lower()
s2 = input().lower()
s3 = input().lower()
for i in s1:
	if i == 'a' or i == 'e' or i == 'o' or (i == 'i') or (i == 'u'):
		c1 += 1
for i in s2:
	if i == 'a' or i == 'e' or i == 'o' or (i == 'i') or (i == 'u'):
		c2 += 1
for i in s3:
	if i == 'a' or i == 'e' or i == 'o' or (i == 'i') or (i == 'u'):
		c3 += 1
if c1 == 5 and c2 == 7 and (c3 == 5):
	print('YES')
	exit(0)
else:
	print('NO')
	exit(0)


a = []
for i in range(3):
	s = input()
	a.append(s)

def fn(a):
	vow = ['a', 'e', 'i', 'o', 'u']
	(c1, c2, c3) = (0, 0, 0)
	for i in range(3):
		for j in a[i]:
			if j in vow and i == 0:
				c1 += 1
			elif j in vow and i == 1:
				c2 += 1
			elif j in vow and i == 2:
				c3 += 1
	if c1 == 5 and c2 == 7 and (c3 == 5):
		return 'YES'
	else:
		return 'NO'
print(fn(a))


a = []
for i in range(3):
	a.append(input())
dic = []
vowel = 'aeiou'
for val in a:
	count = 0
	for i in range(len(val)):
		if val[i] in vowel:
			count += 1
	dic.append(count)
if dic.count(5) == 2 and dic.count(7) == 1:
	print('YES')
else:
	print('NO')


syl = ('a', 'e', 'i', 'o', 'u')
desired_count = (5, 7, 5)

def count(s):
	return sum((1 for x in s if x in syl))
inp = []
ok = True
for i in range(3):
	c = count(input())
	if c != desired_count[i]:
		ok = False
print('YES' if ok else 'NO')


from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

def read_int():
	return int(stdin.readline())

def read_ints():
	return [int(x) for x in stdin.readline().split()]

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]
ans = 'YES'
for i in range(3):
	curr = input()
	count = sum([1 for x in curr if x in 'aeiou'])
	if i in [0, 2] and count == 5 or (i == 1 and count == 7):
		continue
	else:
		ans = 'NO'
		break
print(ans)


for i in range(1, 4):
	s = input()
	sum = s.count('a') + s.count('e') + s.count('i') + s.count('o') + s.count('u')
	if i == 2 and sum != 7 or (i != 2 and sum != 5):
		exit(print('NO'))
print('YES')


a = input()
b = input()
c = input()

def c_v(s):
	l = ['a', 'e', 'i', 'o', 'u']
	cnt = 0
	for i in range(len(s)):
		if s[i] in l:
			cnt += 1
	return cnt
if c_v(a) == 5 and c_v(b) == 7 and (c_v(c) == 5):
	print('YES')
else:
	print('NO')


x = input().strip()
y = input().strip()
z = input().strip()
c = 0
for i in x:
	if i in ['a', 'e', 'i', 'o', 'u']:
		c += 1
if c != 5:
	print('NO')
else:
	c = 0
	for i in y:
		if i in ['a', 'e', 'i', 'o', 'u']:
			c += 1
	if c != 7:
		print('NO')
	else:
		c = 0
		for i in z:
			if i in ['a', 'e', 'i', 'o', 'u']:
				c += 1
		if c != 5:
			print('NO')
		else:
			print('YES')


p = [input() for i in range(3)]
count = lambda x: sum((p[x].count(c) for c in 'aeiou'))
print('YNEOS'[count(0) != 5 or count(1) != 7 or count(2) != 5::2])


l1 = list(input().split())
l2 = list(input().split())
l3 = list(input().split())
count = 0
for i in l1:
	for j in range(len(i)):
		if i[j] == 'a' or i[j] == 'e' or i[j] == 'i' or (i[j] == 'o') or (i[j] == 'u'):
			count += 1
if count == 5:
	count = 0
	for i in l2:
		for j in range(len(i)):
			if i[j] == 'a' or i[j] == 'e' or i[j] == 'i' or (i[j] == 'o') or (i[j] == 'u'):
				count += 1
	if count == 7:
		count = 0
		for i in l3:
			for j in range(len(i)):
				if i[j] == 'a' or i[j] == 'e' or i[j] == 'i' or (i[j] == 'o') or (i[j] == 'u'):
					count += 1
		if count == 5:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
else:
	print('NO')


def readln():
	return tuple(map(int, input().split()))
g = list('aeiou')
print('YES' if [len([1 for c in list(input()) if c in g]) for _ in range(3)] == [5, 7, 5] else 'NO')


s = [list(input().split(' ')) for i in range(3)]
sup0 = 0
sup1 = 0
sup2 = 0
for i in range(len(s[0])):
	sup0 = sup0 + s[0][i].count('a') + s[0][i].count('e') + s[0][i].count('i') + s[0][i].count('o') + s[0][i].count('u')
for i in range(len(s[1])):
	sup1 = sup1 + s[1][i].count('a') + s[1][i].count('e') + s[1][i].count('i') + s[1][i].count('o') + s[1][i].count('u')
for i in range(len(s[2])):
	sup2 = sup2 + s[2][i].count('a') + s[2][i].count('e') + s[2][i].count('i') + s[2][i].count('o') + s[2][i].count('u')
if sup0 == 5 and sup1 == 7 and (sup2 == 5):
	print('YES')
else:
	print('NO')


Line1 = input()
Line2 = input()
Line3 = input()
Vowels1 = 0
Vowels2 = 0
Vowels3 = 0
for letter in Line1:
	if letter in 'aieou':
		Vowels1 += 1
for letter in Line2:
	if letter in 'aieou':
		Vowels2 += 1
for letter in Line3:
	if letter in 'aieou':
		Vowels3 += 1
if Vowels1 == 5 and Vowels2 == 7 and (Vowels3 == 5):
	print('YES')
else:
	print('NO')


import sys
I1 = lambda : map(int, input().split())
I = lambda : input()

def cal(s, vowel):
	c = 0
	for i in s:
		if i in vowel:
			c += 1
	return c
(a1, a2, a3) = (I(), I(), I())
vowel = 'aeiou'
print('YES' if cal(a1, vowel) == 5 and cal(a2, vowel) == 7 and (cal(a3, vowel) == 5) else 'NO')


import sys
data = sys.stdin.readlines()
p1 = data[0].strip()
p2 = data[1].strip()
p3 = data[2].strip()
c1 = 0
c2 = 0
c3 = 0
check = False
for ch in p1:
	if ch in 'aeiou':
		c1 += 1
if c1 == 5:
	for ch in p2:
		if ch in 'aeiou':
			c2 += 1
if c2 == 7:
	for ch in p3:
		if ch in 'aeiou':
			c3 += 1
if c3 == 5:
	check = True
if check == True:
	print('YES')
else:
	print('NO')


from sys import stdin
vowels = 'aeiou'
for i in range(3):
	line = stdin.readline()
	count = 0
	for char in line:
		if char in vowels:
			count += 1
	if i == 0 or i == 2:
		if count != 5:
			print('NO')
			exit()
	if i == 1:
		if count != 7:
			print('NO')
			exit()
print('YES')


l = [input().strip() for i in range(3)]
k = [0] * 3
for i in range(len(l)):
	for j in l[i]:
		if j in 'aeiou':
			k[i] += 1
if k == [5, 7, 5]:
	print('YES')
else:
	print('NO')


a = input()
b = input()
c = input()
x = y = z = 0
v = list('aeoui')
for i in a:
	if i in v:
		x += 1
for i in b:
	if i in v:
		y += 1
for i in c:
	if i in v:
		z += 1
if x == 5 and y == 7 and (z == 5):
	print('YES')
else:
	print('NO')


n = input()
m = input()
d = input()
k = n.count('a') + n.count('e') + n.count('i') + n.count('o') + n.count('u')
k2 = m.count('a') + m.count('e') + m.count('i') + m.count('o') + m.count('u')
k3 = d.count('a') + d.count('e') + d.count('i') + d.count('o') + d.count('u')
if k == 5 and k2 == 7 and (k3 == 5):
	print('YES')
else:
	print('NO')


ok = True
for i in range(0, 3):
	line = input()
	ok = ok and sum((line.count(k) for k in 'aeiou')) == [5, 7, 5][i]
print(['YES', 'NO'][0 if ok else 1])


lst = ['a', 'e', 'i', 'o', 'u']
a = 0
s = 0
for i in range(3):
	x = input()
	for j in range(5):
		a += x.count(lst[j])
	if i == 0 or i == 2:
		if a != 5:
			s += 1
	elif a != 7:
		s += 1
	a = 0
print(['NO', 'YES'][s == 0])


l = ['a', 'e', 'i', 'o', 'u']
for i in range(0, 3):
	c = 0
	a = ''.join(input().split())
	for j in a:
		if j in l:
			c += 1
	if i == 0 and c == 5:
		continue
	elif i == 1 and c == 7:
		continue
	elif i == 2 and c == 5:
		print('YES')
	else:
		print('NO')
		break


s1 = input().strip()
s2 = input().strip()
s3 = input().strip()
count1 = count2 = count3 = 0
for i in range(len(s1)):
	if s1[i] == 'a' or s1[i] == 'e' or s1[i] == 'i' or (s1[i] == 'u') or (s1[i] == 'o'):
		count1 += 1
for i in range(len(s2)):
	if s2[i] == 'a' or s2[i] == 'e' or s2[i] == 'i' or (s2[i] == 'u') or (s2[i] == 'o'):
		count2 += 1
for i in range(len(s3)):
	if s3[i] == 'a' or s3[i] == 'e' or s3[i] == 'i' or (s3[i] == 'u') or (s3[i] == 'o'):
		count3 += 1
	elif s3[i] == ' ':
		continue
if count1 == 5 and count2 == 7 and (count3 == 5):
	print('YES')
else:
	print('NO')


import sys

def countVowel(st):
	aa = 0
	for i in range(len(st)):
		if st[i] == 'a' or st[i] == 'e' or st[i] == 'i' or (st[i] == 'o') or (st[i] == 'u'):
			aa += 1
	return aa
hk = []
for i in range(3):
	a = input().strip()
	hk.append(a)
count = []
chcount = [5, 7, 5]
for i in hk:
	a = countVowel(i)
	count.append(a)
if count == chcount:
	print('YES')
else:
	print('NO')


def solve(arr):
	v = ['a', 'e', 'i', 'o', 'u']
	arr_0 = 5
	arr_1 = 7
	arr_2 = 5
	for i in arr[0]:
		if i in v:
			arr_0 -= 1
	for i in arr[1]:
		if i in v:
			arr_1 -= 1
	for i in arr[2]:
		if i in v:
			arr_2 -= 1
	if arr_0 == 0 and arr_1 == 0 and (arr_2 == 0):
		return 'YES'
	return 'NO'

def main():
	arr = []
	for _ in range(3):
		i = ''.join(filter(lambda x: x != '', input().split(' ')))
		arr.append(i)
	print(solve(arr))
main()


a = input()
b = input()
c = input()
temp = 0
t = 0
p = 0
for i in range(len(a)):
	if a[i] == 'a' or a[i] == 'i' or a[i] == 'e' or (a[i] == 'o') or (a[i] == 'u'):
		temp += 1
for i in range(len(b)):
	if b[i] == 'a' or b[i] == 'i' or b[i] == 'e' or (b[i] == 'o') or (b[i] == 'u'):
		t += 1
for i in range(len(c)):
	if c[i] == 'a' or c[i] == 'i' or c[i] == 'e' or (c[i] == 'o') or (c[i] == 'u'):
		p += 1
if temp == 5 and t == 7 and (p == 5) and (temp + t + p == 17):
	print('YES')
else:
	print('NO')


answer = []
for i in range(3):
	string = input()
	count = 0
	for j in string:
		if j in 'aeiuo':
			count += 1
	answer.append(count)
if answer[0] == 5 and answer[1] == 7 and (answer[-1] == 5):
	print('YES')
else:
	print('NO')


n = ''.join(input().split())
a = 0
for i in n:
	if i == 'a' or i == 'o' or i == 'u' or (i == 'e') or (i == 'i'):
		a += 1
n = ''.join(input().split())
c = 0
for i in n:
	if i == 'a' or i == 'o' or i == 'u' or (i == 'e') or (i == 'i'):
		c += 1
n = ''.join(input().split())
b = 0
for i in n:
	if i == 'a' or i == 'o' or i == 'u' or (i == 'e') or (i == 'i'):
		b += 1
if a == 5 and c == 7 and (b == 5):
	print('YES')
else:
	print('NO')


ls = ['a', 'e', 'i', 'o', 'u']
l1 = input()
l2 = input()
l3 = input()
count1 = 0
count2 = 0
count3 = 0
for i in range(len(l1)):
	if l1[i] in ls:
		count1 += 1
for i in range(len(l2)):
	if l2[i] in ls:
		count2 += 1
for i in range(len(l3)):
	if l3[i] in ls:
		count3 += 1
if count1 == 5 and count2 == 7 and (count3 == 5):
	print('YES')
else:
	print('NO')


l = list(input())
n = list(input())
g = list(input())
count1 = 0
count2 = 0
count3 = 0
for i in l:
	if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
		count1 += 1
for j in n:
	if j == 'a' or j == 'e' or j == 'i' or (j == 'o') or (j == 'u'):
		count2 += 1
for k in g:
	if k == 'a' or k == 'e' or k == 'i' or (k == 'o') or (k == 'u'):
		count3 += 1
if count1 == 5 and count2 == 7 and (count3 == 5):
	print('YES')
else:
	print('NO')


import sys
vowels = 'aeiou'

def vowel_count(line):
	return len([char for char in line if char in vowels])
haiku_syllables = [5, 7, 5]
for i in range(0, 3):
	line = sys.stdin.readline()
	if vowel_count(line) != haiku_syllables[i]:
		print('NO')
		exit(0)
print('YES')


string = str(input())
string_1 = str(input())
string_2 = str(input())
a = 0
b = 0
c = 0
for i in range(len(string)):
	if 'a' in string[i] or 'e' in string[i] or 'i' in string[i] or ('o' in string[i]) or ('u' in string[i]):
		a = a + 1
for i in range(len(string_1)):
	if 'a' in string_1[i] or 'e' in string_1[i] or 'i' in string_1[i] or ('o' in string_1[i]) or ('u' in string_1[i]):
		b = b + 1
for i in range(len(string_2)):
	if 'a' in string_2[i] or 'e' in string_2[i] or 'i' in string_2[i] or ('o' in string_2[i]) or ('u' in string_2[i]):
		c = c + 1
if a == 5 and b == 7 and (c == 5):
	print('YES')
else:
	print('NO')


def vowels(s):
	c = 0
	c = s.count('a') + s.count('e') + s.count('i') + s.count('o') + s.count('u')
	return c
a = input()
b = input()
c = input()
r1 = vowels(a)
r2 = vowels(b)
r3 = vowels(c)
if r1 == 5 and r2 == 7 and (r3 == 5):
	print('YES')
else:
	print('NO')


l1 = input().split()
l2 = input().split()
l3 = input().split()
(t1, t2, t3) = (0, 0, 0)
for l in l1:
	t1 += l.count('a') + l.count('e') + l.count('i') + l.count('o') + l.count('u')
for l in l2:
	t2 += l.count('a') + l.count('e') + l.count('i') + l.count('o') + l.count('u')
for l in l3:
	t3 += l.count('a') + l.count('e') + l.count('i') + l.count('o') + l.count('u')
if t1 != 5 or t2 != 7 or t3 != 5:
	print('NO')
else:
	print('YES')


print(('NO', 'YES')[[sum((c in 'aeiou' for c in input())) for _ in range(3)] == [5, 7, 5]])


t = 0
k = 0
for i in range(3):
	a = input()
	if a.count('a') + a.count('u') + a.count('e') + a.count('i') + a.count('o') == 5 + k % 4:
		t += 1
	k += 2
if t == 3:
	print('YES')
else:
	print('NO')


import sys
import math
import random
sys.setrecursionlimit(2000000)

def Kotaro(c):
	return c in ['a', 'e', 'i', 'o', 'u']

def Hayama(s):
	return len(list(filter(Kotaro, s)))
if Hayama(input()) == 5 and Hayama(input()) == 7 and (Hayama(input()) == 5):
	print('YES')
else:
	print('NO')


l1 = input()
l2 = input()
l3 = input()
haiku = [l1, l2, l3]
for line in haiku:
	count = 0
	for c in line:
		if c == 'a' or c == 'e' or c == 'i' or (c == 'o') or (c == 'u'):
			count += 1
	if line == haiku[0] and count > 5 or (line == haiku[0] and count < 5):
		print('NO')
		break
	elif line == haiku[1] and count > 7 or (line == haiku[1] and count < 7):
		print('NO')
		break
	elif line == haiku[2] and count > 5 or (line == haiku[2] and count < 5):
		print('NO')
		break
if count == 5:
	print('YES')


import re
a = input()
b = input()
c = input()
r = re.compile('[aeiou]')
l1 = r.findall(a)
l2 = r.findall(b)
l3 = r.findall(c)
if len(l1) == 5 and len(l2) == 7 and (len(l3) == 5):
	print('YES')
else:
	print('NO')


def checkVowel(str1):
	cnt = 0
	for i in str1:
		if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
			cnt += 1
	return cnt

def checkHaiku(str1: str, str2: str, str3: str) -> bool:
	v1 = checkVowel(str1)
	v2 = checkVowel(str2)
	v3 = checkVowel(str3)
	if v1 == 5 and v2 == 7 and (v3 == 5):
		return True
	else:
		return False

def main():
	str1 = str(input())
	str2 = str(input())
	str3 = str(input())
	if checkHaiku(str1, str2, str3) == True:
		print('YES')
	else:
		print('NO')
main()


vowels = ['a', 'e', 'i', 'o', 'u']

def haiku(x):
	count = 0
	for elem in x:
		if elem in vowels:
			count += 1
	return count
s = input()
t = input()
w = input()
if haiku(s) == 5 and haiku(t) == 7 and (haiku(w) == 5):
	print('YES')
else:
	print('NO')


h = []
h.extend((input() for _ in range(3)))
v = ['a', 'e', 'i', 'o', 'u']
s = [sum((line.count(e) for e in v)) for line in h]
print('YES' if s == [5, 7, 5] else 'NO')


haiku = [input().strip() for i in range(3)]
vowels = 'aeiou'
vowels_in_haiku = 0
for i in haiku[0]:
	if i in vowels:
		if vowels_in_haiku == 5:
			print('NO')
			exit()
		vowels_in_haiku += 1
if vowels_in_haiku < 5:
	print('NO')
	exit()
vowels_in_haiku = 0
for i in haiku[1]:
	if i in vowels:
		if vowels_in_haiku == 7:
			print('NO')
			exit()
		vowels_in_haiku += 1
if vowels_in_haiku < 7:
	print('NO')
	exit()
vowels_in_haiku = 0
for i in haiku[2]:
	if i in vowels:
		if vowels_in_haiku == 5:
			print('NO')
			exit()
		vowels_in_haiku += 1
if vowels_in_haiku < 5:
	print('NO')
	exit()
print('YES')


a = input()
b = input()
c = input()
k = 0
p = 0
h = 0
for i in range(len(a)):
	if a[i] == 'a' or a[i] == 'e' or a[i] == 'i' or (a[i] == 'o') or (a[i] == 'u'):
		k = k + 1
	if k > 5:
		break
for i in range(len(b)):
	if b[i] == 'a' or b[i] == 'e' or b[i] == 'i' or (b[i] == 'o') or (b[i] == 'u'):
		p = p + 1
	if p > 7:
		break
for i in range(len(c)):
	if c[i] == 'a' or c[i] == 'e' or c[i] == 'i' or (c[i] == 'o') or (c[i] == 'u'):
		h = h + 1
	if h > 5:
		break
if k == h == 5 and p == 7:
	print('YES')
else:
	print('NO')


b = input()
c = input()
d = input()
x1 = b.count('a') + b.count('e') + b.count('i') + b.count('o') + b.count('u')
x2 = c.count('a') + c.count('e') + c.count('i') + c.count('o') + c.count('u')
x3 = d.count('a') + d.count('e') + d.count('i') + d.count('o') + d.count('u')
if x1 == 5 and x2 == 7 and (x3 == 5):
	print('YES')
else:
	print('NO')


r = 0
for i in [0, 1, 2]:
	r |= sum((x in 'aeiou' for x in input())) != 5 + i % 2 * 2
print('YNEOS'[r::2])


s = input()
s1 = input()
s2 = input()
sum1 = sum2 = sum3 = 0
lst = ['a', 'e', 'i', 'o', 'u']
for i in lst:
	sum1 += s.count(i)
	sum2 += s1.count(i)
	sum3 += s2.count(i)
if sum1 == 5 and sum2 == 7 and (sum3 == 5):
	print('YES')
else:
	print('NO')


cases = 3
vows = {'a', 'e', 'i', 'o', 'u'}
ans = []
target = [5, 7, 5]
while cases:
	cases -= 1
	ct = 0
	s = input()
	for char in s:
		if char in vows:
			ct += 1
	ans.append(ct)
if ans == target:
	print('YES')
else:
	print('NO')


cnt = lambda x: x.count('a') + x.count('e') + x.count('i') + x.count('o') + x.count('u')
strs = [input() for i in range(3)]
if cnt(strs[0]) == 5 and cnt(strs[1]) == 7 and (cnt(strs[2]) == 5):
	print('YES')
else:
	print('NO')


import re
regex = re.compile('[a|e|i|o|u]')
first_line = len(regex.findall(input()))
second_line = len(regex.findall(input()))
third_line = len(regex.findall(input()))
if first_line == 5 and second_line == 7 and (third_line == 5):
	print('YES')
else:
	print('NO')


a = input().split()
d = 0
e = 0
f = 0
for j in a:
	for i in j:
		if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
			d = d + 1
b = input().split()
for j in b:
	for i in j:
		if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
			e = e + 1
c = input().split()
for j in c:
	for i in j:
		if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
			f = f + 1
if d == 5 and e == 7 and (f == 5):
	print('YES')
else:
	print('NO')


words = list()
vowels = ['a', 'e', 'i', 'o', 'u']
count = 0
end = list()
for i in range(3):
	for letter in input():
		if letter in vowels:
			count += 1
	end.append(count)
if count == 17 and end == [5, 12, 17]:
	print('YES')
else:
	print('NO')


g1 = input()
g2 = input()
g3 = input()
if g1.count('a') + g1.count('e') + g1.count('i') + g1.count('o') + g1.count('u') == 5 and g2.count('a') + g2.count('e') + g2.count('i') + g2.count('o') + g2.count('u') == 7 and (g3.count('a') + g3.count('e') + g3.count('i') + g3.count('o') + g3.count('u') == 5):
	print('YES')
else:
	print('NO')


def countVowels(string):
	vowels = 'aeiou'
	count = 0
	for i in string:
		if i in vowels:
			count += 1
	return count
poem = []
for i in range(3):
	poem.append(input())
isHaiku = True
for i in range(len(poem)):
	temp = poem[i].lower()
	count = countVowels(temp)
	if i == 0 or i == 2:
		if count == 5:
			pass
		else:
			isHaiku = False
			break
	elif count == 7:
		pass
	else:
		isHaiku = False
		break
print('YES' if isHaiku else 'NO')


vowels = ['a', 'e', 'i', 'o', 'u']
line1 = input()
line2 = input()
line3 = input()

def nr_vowels(line):
	return sum((line.count(letter) for letter in vowels))
if nr_vowels(line1) == 5 and nr_vowels(line2) == 7 and (nr_vowels(line3) == 5):
	print('YES')
else:
	print('NO')


def is_v(c):
	if c == 'a' or c == 'e' or c == 'i' or (c == 'o') or (c == 'u'):
		return 1
	else:
		return 0
a = input()
b = input()
c = input()
c_a = 0
c_b = 0
c_c = 0
for i in range(len(a)):
	if is_v(a[i]):
		c_a += 1
for i in range(len(b)):
	if is_v(b[i]):
		c_b += 1
for i in range(len(c)):
	if is_v(c[i]):
		c_c += 1
if c_a == 5 and c_b == 7 and (c_c == 5):
	print('YES')
else:
	print('NO')


s = []
for i in range(3):
	tmp = input()
	s.append(tmp)
count = []
for i in s:
	tmp_count = i.count('a')
	tmp_count += i.count('e')
	tmp_count += i.count('o')
	tmp_count += i.count('i')
	tmp_count += i.count('u')
	count.append(tmp_count)
if count == [5, 7, 5]:
	print('YES')
else:
	print('NO')


import math
import sys
import re
s1 = input().strip()
s2 = input().strip()
s3 = input().strip()
v1 = s1.count('a') + s1.count('e') + s1.count('i') + s1.count('o') + s1.count('u')
v2 = s2.count('a') + s2.count('e') + s2.count('i') + s2.count('o') + s2.count('u')
v3 = s3.count('a') + s3.count('e') + s3.count('i') + s3.count('o') + s3.count('u')
if v1 != 5 or v2 != 7 or v3 != 5:
	print('NO')
else:
	print('YES')


a = input()
b = input()
c = input()
c1 = 0
c2 = 0
c3 = 0
for i in a:
	if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
		c1 = c1 + 1
for i in b:
	if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
		c2 = c2 + 1
for i in c:
	if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
		c3 = c3 + 1
print('YES' if c1 == 5 and c2 == 7 and (c3 == 5) else 'NO')


def countVowels(s):
	cnt = 0
	for i in s:
		if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
			cnt += 1
	return cnt
s1 = input()
s2 = input()
s3 = input()
if countVowels(s1) == 5 and countVowels(s2) == 7 and (countVowels(s3) == 5):
	print('YES')
else:
	print('NO')


a = input()
b = input()
c = input()
count1 = 0
count2 = 0
count3 = 0
for i in range(len(a)):
	if a[i] == 'a':
		count1 += 1
	if a[i] == 'e':
		count1 += 1
	if a[i] == 'i':
		count1 += 1
	if a[i] == 'o':
		count1 += 1
	if a[i] == 'u':
		count1 += 1
for i in range(len(b)):
	if b[i] == 'a':
		count2 += 1
	if b[i] == 'e':
		count2 += 1
	if b[i] == 'i':
		count2 += 1
	if b[i] == 'o':
		count2 += 1
	if b[i] == 'u':
		count2 += 1
for i in range(len(c)):
	if c[i] == 'a':
		count3 += 1
	if c[i] == 'e':
		count3 += 1
	if c[i] == 'i':
		count3 += 1
	if c[i] == 'o':
		count3 += 1
	if c[i] == 'u':
		count3 += 1
if count1 == 5 and count2 == 7 and (count3 == 5):
	print('YES')
else:
	print('NO')


line1 = input()
line2 = input()
line3 = input()
list = [line1, line2, line3]
vowelcount1 = 0
vowelcount2 = 0
vowelcount3 = 0
vowelist = ['a', 'e', 'i', 'o', 'u']
for i in range(3):
	vowelcount = 0
	for j in range(len(list[i])):
		if list[i][j] in vowelist:
			vowelcount += 1
	if i == 0:
		vowelcount1 = vowelcount
	elif i == 1:
		vowelcount2 = vowelcount
	elif i == 2:
		vowelcount3 = vowelcount
if vowelcount1 == 5 and vowelcount2 == 7 and (vowelcount3 == 5):
	print('YES')
else:
	print('NO')


ans = True
s = input().lower()
ans &= 5 == s.count('a') + s.count('i') + s.count('e') + s.count('o') + s.count('u')
s = input().lower()
ans &= 7 == s.count('a') + s.count('i') + s.count('e') + s.count('o') + s.count('u')
s = input().lower()
ans &= 5 == s.count('a') + s.count('i') + s.count('e') + s.count('o') + s.count('u')
print('YES' if ans else 'NO')


import sys
import math
input = sys.stdin.readline

def f(s):
	c = 0
	for x in s:
		if x in 'aeiou':
			c += 1
	return c
a = input()
b = input()
c = input()
print(('NO', 'YES')[f(a) == 5 and f(b) == 7 and (f(c) == 5)])


x = input()
y = input()
z = input()
ans = 0
lis = [5, 7, 5]
lis2 = [x, y, z]

def check(str):
	cnt = 0
	for i in str:
		if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
			cnt += 1
	return cnt
for i in range(len(lis)):
	if check(lis2[i]) == lis[i]:
		ans += 1
if ans == 3:
	print('YES')
else:
	print('NO')


x = input()
y = input()
z = input()
c1 = x.count('a') + x.count('e') + x.count('i') + x.count('o') + x.count('u')
c2 = y.count('a') + y.count('e') + y.count('i') + y.count('o') + y.count('u')
c3 = z.count('a') + z.count('e') + z.count('i') + z.count('o') + z.count('u')
if c1 == 5 and c2 == 7 and (c3 == 5):
	print('YES')
else:
	print('NO')


a = input()
b = input()
c = input()
l = ['a', 'e', 'i', 'o', 'u']
d = 0
e = 0
f = 0
for i in a:
	if i in l:
		d += 1
for i in b:
	if i in l:
		e += 1
for i in c:
	if i in l:
		f += 1
if d == 5 and e == 7 and (f == 5):
	print('YES')
else:
	print('NO')


vowels = 'aeiou'
answer = True

def good(line, n):
	count = 0
	for i in range(len(line)):
		if line[i] in vowels:
			count += 1
	if count == n:
		return True
	else:
		return False
for i in range(3):
	line = input()
	if i % 2 == 0:
		if good(line, 5) == True:
			continue
		else:
			answer = False
			break
	elif good(line, 7) == True:
		continue
	else:
		answer = False
		break
if answer:
	print('YES')
else:
	print('NO')


def f(s):
	ans = 0
	for item in s:
		if item in 'aeiou':
			ans += 1
	return ans
win = 'YES'
s = input()
if f(s) != 5:
	win = 'NO'
s = input()
if f(s) != 7:
	win = 'NO'
s = input()
if f(s) != 5:
	win = 'NO'
print(win)


import sys
import math
st = [''] * 3
st[0] = sys.stdin.readline().split()
st[1] = sys.stdin.readline().split()
st[2] = sys.stdin.readline().split()
r = [0] * 3
for s in range(3):
	for i in st[s]:
		for j in i:
			if j == 'a' or j == 'e' or j == 'i' or (j == 'o') or (j == 'u'):
				r[s] += 1
if r[0] == 5 and r[2] == 5 and (r[1] == 7):
	print('YES')
else:
	print('NO')


isOk = 'YES'
s = input()
if s.count('a') + s.count('e') + s.count('i') + s.count('o') + s.count('u') != 5:
	isOk = 'NO'
s = input()
if s.count('a') + s.count('e') + s.count('i') + s.count('o') + s.count('u') != 7:
	isOk = 'NO'
s = input()
if s.count('a') + s.count('e') + s.count('i') + s.count('o') + s.count('u') != 5:
	isOk = 'NO'
print(isOk)


a = input()
c1 = 0
vowels = {'A', 'E', 'I', 'O', 'U', 'a', 'e', 'i', 'o', 'u'}
for letter in a:
	if letter in vowels:
		c1 += 1
b = input()
c2 = 0
for letter in b:
	if letter in vowels:
		c2 += 1
c = input()
c3 = 0
for letter in c:
	if letter in vowels:
		c3 += 1
if c1 == 5 and c2 == 7 and (c3 == 5):
	print('YES')
else:
	print('NO')


vowels = set('aeiou')
count = lambda : sum((1 for c in input() if c in vowels))
print('YES' if count() == 5 and count() == 7 and (count() == 5) else 'NO')


import sys

def haiku(s):
	ans = 0
	ans += s.count('a', 0, len(s))
	ans += s.count('e', 0, len(s))
	ans += s.count('i', 0, len(s))
	ans += s.count('o', 0, len(s))
	ans += s.count('u', 0, len(s))
	return ans
s = str(input())
if haiku(s) != 5:
	print('NO')
	sys.exit()
s = str(input())
if haiku(s) != 7:
	print('NO')
	sys.exit()
s = str(input())
if haiku(s) != 5:
	print('NO')
	sys.exit()
print('YES')


N = 3
i = 0
vowels = 'aeiou'
ex = [5, 7, 5]
op = []
while i < N:
	line = input()
	cnt = len([c for c in line if c in vowels])
	op.append(cnt)
	i += 1
if op != ex:
	print('NO')
else:
	print('YES')


l1 = ['a', 'e', 'i', 'o', 'u']
k = 0
s = input()
for x in s:
	if x in l1:
		k += 1
if k != 5:
	print('NO')
	exit()
k = 0
s = input()
for x in s:
	if x in l1:
		k += 1
if k != 7:
	print('NO')
	exit()
k = 0
s = input()
for x in s:
	if x in l1:
		k += 1
if k != 5:
	print('NO')
	exit()
print('YES')


a = input()
b = input()
c = input()
t = 0
for i in a:
	if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
		t += 1
if t == 5:
	t = 0
	for i in b:
		if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
			t += 1
	if t == 7:
		t = 0
		for i in c:
			if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
				t += 1
		if t == 5:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
else:
	print('NO')


count = [0, 0, 0]
for i in range(3):
	ln = input()
	for j in range(len(ln)):
		if ln[j] == 'a' or ln[j] == 'e' or ln[j] == 'i' or (ln[j] == 'o') or (ln[j] == 'u'):
			count[i] += 1
if count == [5, 7, 5]:
	print('YES')
else:
	print('NO')


def syllables(s):
	return s.count('a') + s.count('e') + s.count('i') + s.count('o') + s.count('u')
phrase1 = input()
phrase2 = input()
phrase3 = input()
if syllables(phrase1) == 5 and syllables(phrase2) == 7 and (syllables(phrase3) == 5):
	print('YES')
else:
	print('NO')


def check(line):
	return sum([line.count('o'), line.count('a'), line.count('e'), line.count('i'), line.count('u')])
first = check(input())
second = check(input())
third = check(input())
if first != 5 or second != 7 or third != 5:
	print('NO')
else:
	print('YES')


s1 = input()
s2 = input()
s3 = input()
v = ['a', 'e', 'i', 'o', 'u']
isValid = True
(v1, v2, v3) = (0, 0, 0)
for i in s1:
	if i in v:
		v1 += 1
for i in s2:
	if i in v:
		v2 += 1
for i in s3:
	if i in v:
		v3 += 1
if v1 != 5:
	isValid = False
if v2 != 7:
	isValid = False
if v3 != 5:
	isValid = False
print('YES' if isValid else 'NO')


ishaiku = 0
for i in range(3):
	sentence = input().lower()
	if i == 0 or i == 2:
		if sentence.count('a') + sentence.count('e') + sentence.count('i') + sentence.count('o') + sentence.count('u') == 5:
			ishaiku += 1
	elif sentence.count('a') + sentence.count('e') + sentence.count('i') + sentence.count('o') + sentence.count('u') == 7:
		ishaiku += 1
if ishaiku == 3:
	print('YES')
else:
	print('NO')


def check(g, m):
	c = 0
	for i in g:
		if i in ['a', 'e', 'i', 'o', 'u']:
			c += 1
	return 1 if c == m else 0

def main():
	mode = 'filee'
	if mode == 'file':
		f = open('test.txt', 'r')
	get = lambda : [int(x) for x in (f.readline() if mode == 'file' else input()).split()]
	g = []
	for i in range(3):
		g.append(input())
	if check(g[0], 5) == 1 and check(g[1], 7) == 1 and (check(g[2], 5) == 1):
		print('YES')
	else:
		print('NO')
	if mode == 'file':
		f.close()
main()


def count_vowels(s):
	return sum((c in set('aeoui') for c in s))
counts = [count_vowels(input()) for _ in range(3)]
print(('NO', 'YES')[counts == [5, 7, 5]])


l = 'aioue'
x = input()
y = input()
z = input()
(xx, yy, zz) = (0, 0, 0)
for i in x:
	if i in l:
		xx += 1
for i in y:
	if i in l:
		yy += 1
for i in z:
	if i in l:
		zz += 1
if xx == 5 and yy == 7 and (zz == 5):
	print('YES')
else:
	print('NO')


import sys
s1 = str(input())
s2 = str(input())
s3 = str(input())
r1 = 0
r2 = 0
r3 = 0
for i in s1:
	if i == 'u' or i == 'i' or i == 'a' or (i == 'e') or (i == 'o'):
		r1 += 1
if r1 != 5:
	print('NO')
	sys.exit()
for i in s2:
	if i == 'u' or i == 'i' or i == 'a' or (i == 'e') or (i == 'o'):
		r2 += 1
if r2 != 7:
	print('NO')
	sys.exit()
for i in s3:
	if i == 'u' or i == 'i' or i == 'a' or (i == 'e') or (i == 'o'):
		r3 += 1
if r3 != 5:
	print('NO')
else:
	print('YES')


a = ['a', 'e', 'i', 'o', 'u']
b = list(input())
c = list(input())
d = list(input())
(l, m, n) = (0, 0, 0)
for i in range(len(b)):
	if b[i] in a:
		l += 1
for i in range(len(c)):
	if c[i] in a:
		m += 1
for i in range(len(d)):
	if d[i] in a:
		n += 1
if l == 5 and n == 5 and (m == 7):
	print('YES')
else:
	print('NO')


v = 'aeiou'
f = 1
for i in range(3):
	c = 0
	for j in input():
		if j in v:
			c += 1
	if i & 1 and c != 7:
		f = 0
	if not i & 1 and c != 5:
		f = 0
if f:
	print('YES')
else:
	print('NO')


from sys import stdin
import math
A = stdin.readline()
B = stdin.readline()
C = stdin.readline()
count = 0
K = 0
for j in A:
	if (j == 'a' or j == 'e') or (j == 'i' or (j == 'o' or j == 'u')):
		count += 1
	if count > 5:
		K = 1
		break
if count != 5 or K == 1:
	print('NO')
else:
	count = 0
	for j in B:
		if (j == 'a' or j == 'e') or (j == 'i' or (j == 'o' or j == 'u')):
			count += 1
		if count > 7:
			K = 1
			break
	if count != 7 or K == 1:
		print('NO')
	else:
		count = 0
		for j in C:
			if (j == 'a' or j == 'e') or (j == 'i' or (j == 'o' or j == 'u')):
				count += 1
			if count > 5:
				K = 1
				break
		if count != 5 or K == 1:
			print('NO')
		else:
			print('YES')


vowels = ('a', 'e', 'i', 'o', 'u')
yes = True
for i in range(3):
	s = input()
	if yes:
		total = 0
		for c in s:
			if c in vowels:
				total += 1
		if i == 0 or i == 2:
			if total != 5:
				yes = False
		elif total != 7:
			yes = False
print('YES' if yes else 'NO')


sl = [input(), input(), input()]
nl = [5, 7, 5]
res = True
for i in range(3):
	ans = 0
	for c in sl[i]:
		if 'aeiou'.count(c):
			ans += 1
	if ans != nl[i]:
		res = False
		break
print(['NO', 'YES'][res])


(a, b, c) = (list(input()), list(input()), list(input()))
(t1, t2, t3) = (0, 0, 0)
for i in a:
	if i == 'a' or i == 'i' or i == 'o' or (i == 'e') or (i == 'u'):
		t1 += 1
for i in b:
	if i == 'a' or i == 'i' or i == 'o' or (i == 'e') or (i == 'u'):
		t2 += 1
for i in c:
	if i == 'a' or i == 'i' or i == 'o' or (i == 'e') or (i == 'u'):
		t3 += 1
if t1 == 5 and t2 == 7 and (t3 == 5):
	print('YES')
else:
	print('NO')


ans = [5, 7, 5]
for i in range(3):
	s = input().strip().split()
	cnt = 0
	for word in s:
		for letter in word:
			if letter in ['a', 'e', 'i', 'o', 'u']:
				cnt += 1
	if cnt != ans[i]:
		print('NO')
		exit()
print('YES')


s = input()
a = 'aeiou'
(c, d, e) = (0, 0, 0)
for i in s:
	if i in a:
		c += 1
s = input()
for i in s:
	if i in a:
		d += 1
s = input()
for i in s:
	if i in a:
		e += 1
if c == 5 and d == 7 and (e == 5):
	print('YES')
else:
	print('NO')


import os
import sys
from io import BytesIO, IOBase
import math
from decimal import Decimal
from decimal import *
from collections import defaultdict, deque
import heapq
from decimal import Decimal
getcontext().prec = 25
abcd = 'abcdefghijklmnopqrstuvwxyz'
ABCD = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
months = {1: 31, 2: 28, 3: 31, 4: 30, 5: 31, 6: 30, 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31}
MOD = 1000000007
BUFSIZE = 8192
from bisect import bisect_left, bisect_right

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
p1 = input()
p2 = input()
p3 = input()
c1 = c2 = c3 = 0
for i in p1:
	if i in 'aeiou':
		c1 += 1
for i in p2:
	if i in 'aeiou':
		c2 += 1
for i in p3:
	if i in 'aeiou':
		c3 += 1
if c1 == c3 == 5 and c2 == 7:
	print('YES')
else:
	print('NO')


s = 0
k = 0
for i in (5, 7, 5):
	s = 0
	n = input().split()
	for m in n:
		for j in m:
			if j in ('a', 'i', 'o', 'e', 'u'):
				s = s + 1
	if s == i:
		k = k + 1
if k == 3:
	print('YES')
else:
	print('NO')


from sys import stdin
i = 0
ans = True
c = [5, 7, 5]
for line in stdin:
	if len([x for x in line if x in 'aeiou']) != c[i]:
		ans = False
	i += 1
print('YES' if ans else 'NO')


a = [5, 7, 5]
for i in range(3):
	(s, count) = (input(), 0)
	for j in s:
		if j in 'aoeiu':
			count += 1
	if count != a[i]:
		print('NO')
		exit()
print('YES')


print('YES' if [sum((s.count(x) for x in 'aeiou')) for s in [input() for _ in range(3)]] == [5, 7, 5] else 'NO')


def answer():
	vowels = 'aeiou'
	l1 = len([x for x in list(input()) if x in vowels])
	l2 = len([x for x in list(input()) if x in vowels])
	l3 = len([x for x in list(input()) if x in vowels])
	if l1 == 5 and l2 == 7 and (l3 == 5):
		print('YES')
	else:
		print('NO')
answer()


import sys

def vowels(k):
	return k.count('a') + k.count('e') + k.count('i') + k.count('o') + k.count('u')

def main():
	a = sys.stdin.readlines()
	for line in a[3:]:
		if line.strip() != '':
			print('NO')
			return
	if vowels(a[0]) != 5 or vowels(a[1]) != 7 or vowels(a[2]) != 5:
		print('NO')
		return
	print('YES')
main()


s1 = input().replace(' ', '')
s2 = input().replace(' ', '')
s3 = input().replace(' ', '')
v1 = 0
v2 = 0
v3 = 0
vowels = ['a', 'e', 'i', 'o', 'u']
for i in range(len(s1)):
	if s1[i] in vowels:
		v1 += 1
for j in range(len(s2)):
	if s2[j] in vowels:
		v2 += 1
for k in range(len(s3)):
	if s3[k] in vowels:
		v3 += 1
if v1 == 5 and v2 == 7 and (v3 == 5):
	print('YES')
else:
	print('NO')


def haiku_check(phrase, number):
	vowels = ['a', 'e', 'i', 'o', 'u']
	number_of_vowels = 0
	for character in phrase:
		if character in vowels:
			number_of_vowels += 1
	if number_of_vowels == number:
		return True
	return False

def haiku_check_full(haiku):
	if not haiku_check(haiku[0], 5):
		return False
	if not haiku_check(haiku[1], 7):
		return False
	if not haiku_check(haiku[2], 5):
		return False
	return True
haiku = []
for i in range(3):
	haiku.append(input())
if haiku_check_full(haiku):
	print('YES')
else:
	print('NO')


from functools import reduce
from operator import *
from math import *
from sys import *
from string import *
from collections import *
setrecursionlimit(10 ** 7)
dX = [-1, 1, 0, 0, -1, 1, -1, 1]
dY = [0, 0, -1, 1, 1, -1, -1, 1]
RI = lambda : list(map(int, input().split()))
RS = lambda : input().rstrip().split()
flag = 1
for i in range(3):
	s = input()
	cnt = 0
	for j in s:
		if j in 'aeiou':
			cnt += 1
	flag &= cnt - 5 == 2 * (i == 1)
print(['NO', 'YES'][flag])


s = str(input())
s1 = str(input())
s2 = str(input())
s = s.replace(' ', '')
s1 = s1.replace(' ', '')
s2 = s2.replace(' ', '')
c = 0
d = 0
e = 0
for i in range(0, len(s)):
	if s[i] in 'aeiou':
		c = c + 1
for i in range(0, len(s1)):
	if s1[i] in 'aeiou':
		d = d + 1
for i in range(0, len(s2)):
	if s2[i] in 'aeiou':
		e = e + 1
if c == 5 and d == 7 and (e == 5):
	print('YES')
else:
	print('NO')


entrada = ''
rip = 0

def contar(x):
	contador = 0
	for letra in x:
		if letra == 'a' or letra == 'e' or letra == 'i' or (letra == 'o') or (letra == 'u'):
			contador += 1
	return contador
for i in range(3):
	entrada = input().strip()
	if (i == 0 or i == 2) and contar(entrada) != 5:
		print('NO')
		rip = 1
		break
	if i == 1 and contar(entrada) != 7:
		print('NO')
		rip = 1
		break
if rip != 1:
	print('YES')


l1 = input()
l2 = input()
l3 = input()
l1vow = 0
l2vow = 0
l3vow = 0
for c in l1:
	if c in 'aeiou':
		l1vow += 1
for c in l2:
	if c in 'aeiou':
		l2vow += 1
for c in l3:
	if c in 'aeiou':
		l3vow += 1
if l1vow == 5 and l2vow == 7 and (l3vow == 5):
	print('YES')
else:
	print('NO')


a = ['a', 'e', 'i', 'o', 'u']
t = 0
L = []
for i in range(3):
	s = input()
	for j in s:
		if j in a:
			t += 1
	L.append(t)
	t = 0
if L[0] == L[2] and L[0] == 5 and (L[1] == 7):
	print('YES')
	exit()
print('NO')


a = list(input())
b = list(input())
c = list(input())
v = ['a', 'e', 'i', 'o', 'u']
(d, t, y) = (0, 0, 0)
for j in a:
	if j in v:
		d += 1
for k in b:
	if k in v:
		t += 1
for s in c:
	if s in v:
		y += 1
if d == 5 and t == 7 and (y == 5):
	print('YES')
else:
	print('NO')


l = []
l1 = ['a', 'e', 'i', 'o', 'u']
for i in range(3):
	count = 0
	s = input().split()
	for k in s:
		for j in k:
			if j in l1:
				count += 1
	l.append(count)
if l == [5, 7, 5]:
	print('YES')
else:
	print('NO')


a = []
for _ in range(3):
	d = 0
	k = input().split(' ')
	for i in k:
		for x in i:
			if x == 'a' or x == 'i' or x == 'e' or (x == 'o') or (x == 'u'):
				d += 1
	a.append(d)
print('NO' if a[0] != 5 or a[1] != 7 or a[2] != 5 else 'YES')


a = input()
b = input()
c = input()
is_haiku = True
count = 0
for i in range(len(a)):
	if a[i] in {'a', 'e', 'i', 'o', 'u'}:
		count += 1
if count != 5:
	is_haiku = False
count = 0
for i in range(len(b)):
	if b[i] in {'a', 'e', 'i', 'o', 'u'}:
		count += 1
if count != 7:
	is_haiku = False
count = 0
for i in range(len(c)):
	if c[i] in {'a', 'e', 'i', 'o', 'u'}:
		count += 1
if count != 5:
	is_haiku = False
if is_haiku:
	print('YES')
if not is_haiku:
	print('NO')


a = ['a', 'e', 'i', 'o', 'u']
q = ''
for i in range(3):
	s = 0
	z = input()
	for i in z:
		if i.isalpha():
			if i in a:
				s += 1
	q += str(s)
if q == '575':
	print('YES')
else:
	print('NO')


s = 'aeiou'
r = 'YES'
for i in range(3):
	c = 0
	for j in input():
		if j in s:
			c += 1
	if c != 7 and i == 1 or (c != 5 and (i == 0 or i == 2)):
		r = 'NO'
print(r)


import sys
msg = sys.stdin.readlines()
(f1, f2, f3) = (5, 7, 5)
for i in range(len(msg)):
	if i == 0:
		for word in range(len(msg[i])):
			if msg[i][word] == 'a' or msg[i][word] == 'e' or msg[i][word] == 'i' or (msg[i][word] == 'o') or (msg[i][word] == 'u'):
				f1 -= 1
	if i == 1:
		for word in range(len(msg[i])):
			if msg[i][word] == 'a' or msg[i][word] == 'e' or msg[i][word] == 'i' or (msg[i][word] == 'o') or (msg[i][word] == 'u'):
				f2 -= 1
	if i == 2:
		for word in range(len(msg[i])):
			if msg[i][word] == 'a' or msg[i][word] == 'e' or msg[i][word] == 'i' or (msg[i][word] == 'o') or (msg[i][word] == 'u'):
				f3 -= 1
if f1 == 0 and f2 == 0 and (f3 == 0):
	print('YES')
else:
	print('NO')


Result = ''
for i in range(3):
	Result += str(len(''.join(filter(lambda x: True if x in 'aioue' else False, input()))))
print('YES' if Result == '575' else 'NO')


s1 = input()
s2 = input()
s3 = input()
s1.replace(' ', '')
s2.replace(' ', '')
s3.replace(' ', '')
cond = False
count = 0
for i in range(0, len(s1)):
	if s1[i] == 'a' or s1[i] == 'e' or s1[i] == 'i' or (s1[i] == 'o') or (s1[i] == 'u'):
		count += 1
if count == 5:
	count = 0
	for i in range(0, len(s2)):
		if s2[i] == 'a' or s2[i] == 'e' or s2[i] == 'i' or (s2[i] == 'o') or (s2[i] == 'u'):
			count += 1
if count == 7:
	count = 0
	for i in range(0, len(s3)):
		if s3[i] == 'a' or s3[i] == 'e' or s3[i] == 'i' or (s3[i] == 'o') or (s3[i] == 'u'):
			count += 1
if count == 5:
	cond = True
if cond:
	print('YES')
else:
	print('NO')


def cv(s):
	return sum((s.count(x) for x in 'aeiou'))
ans = 'YES'
cnt = [5, 7, 5]
for i in range(3):
	if cv(input()) != cnt[i]:
		ans = 'NO'
print(ans)


a = (len(tuple(filter(lambda x: x in 'aeiou', input()))) for i in range(3))
print(('NO', 'YES')[tuple(a) == (5, 7, 5)])


def is_wovel(c):
	return c in ['a', 'e', 'i', 'o', 'u']

def count(s):
	return len(list(filter(is_wovel, s)))
if count(input()) == 5 and count(input()) == 7 and (count(input()) == 5):
	print('YES')
else:
	print('NO')


def single_integer():
	return int(input())

def multi_integer():
	return map(int, input().split())

def string():
	return input()

def multi_string():
	return input().split()
vowels = {'a', 'e', 'i', 'o', 'u'}
answers = (5, 7, 5)
for j in answers:
	temp = 0
	s = input()
	for i in s:
		if i in vowels:
			temp += 1
	if temp != j:
		print('NO')
		break
else:
	print('YES')


from functools import reduce
vow = 'aeiou'
(a, b, c) = (input(), input(), input())
count_a = reduce(lambda aa, bb: aa + a.count(bb), vow, 0)
count_b = reduce(lambda aa, bb: aa + b.count(bb), vow, 0)
count_c = reduce(lambda aa, bb: aa + c.count(bb), vow, 0)
if (count_a, count_b, count_c) == (5, 7, 5):
	print('YES')
else:
	print('NO')


s = str(input())
t = str(input())
u = str(input())
L = ['a', 'e', 'i', 'o', 'u']
l1 = 0
l2 = 0
l3 = 0
for i in range(0, len(s)):
	if s[i] in L:
		l1 += 1
if l1 != 5:
	print('NO')
else:
	for i in range(0, len(t)):
		if t[i] in L:
			l2 += 1
	if l2 != 7:
		print('NO')
	else:
		for i in range(0, len(u)):
			if u[i] in L:
				l3 += 1
		if l3 == 5:
			print('YES')
		else:
			print('NO')


def myCount(s, g):
	c = 0
	for i in g:
		c += s.count(i)
	return c
(a, b, c) = (input(), input(), input())
g = ['a', 'e', 'i', 'o', 'u']
n = myCount(a, g)
m = myCount(b, g)
k = myCount(c, g)
if n == 5 and m == 7 and (k == 5):
	print('YES')
else:
	print('NO')


for j in range(3):
	n = 0
	a = input()
	for i in a:
		if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
			n += 1
	if j == 1:
		if n == 7:
			b = True
		else:
			b = False
			break
	elif n == 5:
		b = True
	else:
		b = False
		break
if b == True:
	print('YES')
else:
	print('NO')


vowel = ['a', 'e', 'i', 'o', 'u']
(s, cnt) = (input(), 0)
for i in range(len(s)):
	if s[i] in vowel:
		cnt += 1
if cnt != 5:
	print('NO')
	exit()
(s, cnt) = (input(), 0)
for i in range(len(s)):
	if s[i] in vowel:
		cnt += 1
if cnt != 7:
	print('NO')
	exit()
(s, cnt) = (input(), 0)
for i in range(len(s)):
	if s[i] in vowel:
		cnt += 1
if cnt != 5:
	print('NO')
	exit()
print('YES')


s = input()
s1 = input()
s2 = input()
c = 0
for el in s:
	if el == 'a' or el == 'e' or el == 'i' or (el == 'o') or (el == 'u'):
		c += 1
c1 = 0
for el in s1:
	if el == 'a' or el == 'e' or el == 'i' or (el == 'o') or (el == 'u'):
		c1 += 1
c2 = 0
for el in s2:
	if el == 'a' or el == 'e' or el == 'i' or (el == 'o') or (el == 'u'):
		c2 += 1
if c == 5 and c1 == 7 and (c2 == 5):
	print('YES')
else:
	print('NO')


(p, ans) = ('aeiou', 'NO')
t = input()
if sum((t.count(i) for i in p)) == 5:
	t = input()
	if sum((t.count(i) for i in p)) == 7:
		t = input()
		if sum((t.count(i) for i in p)) == 5:
			ans = 'YES'
print(ans)


line1 = input()
line2 = input()
line3 = input()
count1 = 0
count2 = 0
count3 = 0
for i in line1:
	if i in {'a', 'e', 'i', 'o', 'u'}:
		count1 += 1
for i in line2:
	if i in {'a', 'e', 'i', 'o', 'u'}:
		count2 += 1
for i in line3:
	if i in {'a', 'e', 'i', 'o', 'u'}:
		count3 += 1
if count1 == 5 and count2 == 7 and (count3 == 5):
	print('YES')
else:
	print('NO')


try:
	a = input()
	b = input()
	c = input()
	x = a.count('a') + a.count('u') + a.count('o') + a.count('i') + a.count('e')
	y = b.count('a') + b.count('u') + b.count('o') + b.count('i') + b.count('e')
	z = c.count('a') + c.count('u') + c.count('o') + c.count('i') + c.count('e')
	if x == 5 and y == 7 and (z == 5):
		print('YES')
	else:
		print('NO')
except:
	pass


b = True
for i in range(3):
	s = input()
	cnt = 0
	for j in s:
		if j == 'a' or j == 'e' or j == 'i' or (j == 'o') or (j == 'u'):
			cnt += 1
	if (i == 0 or i == 2) and cnt != 5 or (i == 1 and cnt != 7):
		b = False
if b:
	print('YES')
else:
	print('NO')


vowels = ['a', 'e', 'i', 'o', 'u']
a = [i for i in str(input()) if i in vowels]
b = [i for i in str(input()) if i in vowels]
c = [i for i in str(input()) if i in vowels]
if len(a) == len(c) == 5 and len(b) == 7:
	print('YES')
else:
	print('NO')


l = [5, 7, 5]
d = 0
for i in range(3):
	s = str(input())
	if s.count('a') + s.count('e') + s.count('i') + s.count('o') + s.count('u') == l[i]:
		d += 1
if d == 3:
	print('YES')
else:
	print('NO')


def cnt(s):
	return s.count('a') + s.count('e') + s.count('i') + s.count('o') + s.count('u')
s1 = input()
s2 = input()
s3 = input()
print('YES' if cnt(s1) == 5 and cnt(s2) == 7 and (cnt(s3) == 5) else 'NO')


import re
s = 'aeiou'
k = 0
for c in input():
	if c in s:
		k += 1
if k != 5:
	print('NO')
	exit()
k = 0
for c in input():
	if c in s:
		k += 1
if k != 7:
	print('NO')
	exit()
k = 0
for c in input():
	if c in s:
		k += 1
if k != 5:
	print('NO')
	exit()
print('YES')


def sum(s):
	sum_s1 = 0
	L = ['a', 'e', 'i', 'o', 'u']
	for i in s:
		if i in L:
			sum_s1 += 1
	return sum_s1
s1 = input()
s2 = input()
s3 = input()
sum_s1 = sum(s1)
sum_s2 = sum(s2)
sum_s3 = sum(s3)
if sum_s1 == 5 and sum_s2 == 7 and (sum_s3 == 5):
	print('YES')
else:
	print('NO')


line1 = input()
line2 = input()
line3 = input()
l1 = l2 = l3 = 0
for i in line1:
	if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
		l1 += 1
for i in line2:
	if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
		l2 += 1
for i in line3:
	if i == 'a' or i == 'e' or i == 'i' or (i == 'o') or (i == 'u'):
		l3 += 1
if l1 == 5 and l2 == 7 and (l3 == 5):
	print('YES')
else:
	print('NO')


strs = [input().lower() for i in range(3)]
l = [len([x for x in s if x in 'aeiou']) for s in strs]
if l == [5, 7, 5]:
	print('YES')
else:
	print('NO')


print(('NO', 'YES')[[sum((c in 'aeiou' for c in input())) for _ in '012'] == [5, 7, 5]])


r = []
for i in range(3):
	str = input()
	r.append(str)
c = 0
s = []
for u in r:
	c = 0
	for y in range(len(u)):
		if u[y] in 'aeiou':
			c += 1
	s.append(c)
if s[0] == 5 and s[1] == 7 and (s[2] == 5):
	print('YES')
else:
	print('NO')


haiku = [0, 0, 0]
vowel = 'aeiou'
for i in range(3):
	poem = list(input().split())
	for j in poem:
		for k in j:
			for l in vowel:
				if k == l:
					haiku[i] += 1
if haiku == [5, 7, 5]:
	print('YES')
else:
	print('NO')


(vow, vow2, vow3) = (0, 0, 0)
word = input()
for i in range(len(word)):
	if word[i] in 'aeiou':
		vow += 1
word = input()
for i in range(len(word)):
	if word[i] in 'aeiou':
		vow2 += 1
word = input()
for i in range(len(word)):
	if word[i] in 'aeiou':
		vow3 += 1
if vow == 5 and vow2 == 7 and (vow3 == 5):
	print('YES')
else:
	print('NO')


d = {'a': 0, 'e': 0, 'i': 0, 'o': 0, 'u': 0}
l = [5, 7, 5]
c = 0
for i in range(3):
	c = 0
	t = 1
	s = input()
	for j in s:
		if j in d:
			c += 1
		if c > l[i]:
			t = 0
			break
	if c != l[i]:
		t = 0
	if t == 0:
		print('NO')
		break
if t == 1:
	print('YES')


def num_vowels(s):
	return sum([s.count(v) for v in 'aeiou'])
if num_vowels(input()) == 5 and num_vowels(input()) == 7 and (num_vowels(input()) == 5):
	print('YES')
else:
	print('NO')


if [sum((1 for ch in input() if ch in ['a', 'e', 'i', 'o', 'u'])) for i in range(3)] == [5, 7, 5]:
	print('YES')
else:
	print('NO')


import sys
from array import array

def input():
	return sys.stdin.buffer.readline().decode('utf-8')
a = [input().rstrip() for _ in range(3)]
cnt = [sum((s.count(c) for c in 'aeiou')) for s in a]
if cnt == [5, 7, 5]:
	print('YES')
else:
	print('NO')


v = ['a', 'e', 'i', 'o', 'u']
l = []
for i in range(1, 4):
	s = input().replace(' ', '')
	count = 0
	for j in s:
		if j in v:
			count += 1
	l.append(count)
if l[0] == 5 and l[1] == 7 and (l[2] == 5) and (sum(l) == 17):
	print('YES')
else:
	print('NO')


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 10 ** 9 + 7
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
ans = [5, 7, 5]
ok = 'YES'
for i in range(3):
	s = input().strip()
	syl = 0
	for j in s:
		if j in 'aeiou':
			syl += 1
	if syl != ans[i]:
		ok = 'NO'
print(ok)


a = list(input())
s = list(input())
d = list(input())
l = ['a', 'e', 'i', 'o', 'u']
n = 0
nn = 0
num = 0
for i in a:
	if i in l:
		n += 1
for j in s:
	if j in l:
		nn += 1
for k in d:
	if k in l:
		num += 1
if n == 5 and nn == 7 and (num == 5):
	print('YES')
else:
	print('NO')


list1 = ['a', 'e', 'i', 'o', 'u']
for i in range(0, 3):
	count = 0
	s = ''.join(input().split())
	for j in s:
		if j in list1:
			count += 1
	if i == 0 and count == 5:
		continue
	elif i == 1 and count == 7:
		continue
	elif i == 2 and count == 5:
		print('YES')
	else:
		print('NO')
		break


print('YES' if len([i for i in input() if i in 'aeiou']) == 5 and len([i for i in input() if i in 'aeiou']) == 7 and (len([i for i in input() if i in 'aeiou']) == 5) else 'NO')


s1 = list(input())
s2 = list(input())
s3 = list(input())
ans = [0 for _ in range(3)]
for i in range(len(s1)):
	if s1[i] == 'a' or s1[i] == 'e' or s1[i] == 'i' or (s1[i] == 'o') or (s1[i] == 'u'):
		ans[0] += 1
for i in range(len(s2)):
	if s2[i] == 'a' or s2[i] == 'e' or s2[i] == 'i' or (s2[i] == 'o') or (s2[i] == 'u'):
		ans[1] += 1
for i in range(len(s3)):
	if s3[i] == 'a' or s3[i] == 'e' or s3[i] == 'i' or (s3[i] == 'o') or (s3[i] == 'u'):
		ans[2] += 1
if ans == [5, 7, 5]:
	print('YES')
else:
	print('NO')


poem = [input() for i in range(3)]
vowels = 'aeiou'
if [len([v for v in line if v in vowels]) for line in poem] == [5, 7, 5]:
	print('YES')
else:
	print('NO')


ans = ''
for i in range(3):
	s = input()
	vowels = ['a', 'e', 'i', 'o', 'u']
	cnt = 0
	for ch in s:
		if ch in vowels:
			cnt += 1
	if (i == 0 or i == 2) and cnt == 5 or (i == 1 and cnt == 7):
		ans = 'YES'
	else:
		ans = 'NO'
		break
print(ans)


vowel = 'aiueo'
data = []
for j in range(3):
	pharse = input()
	data.append(pharse)
data1 = []
for i in data:
	count = 0
	for j in i:
		if j in vowel:
			count += 1
	data1.append(count)
if data1 == [5, 7, 5]:
	print('YES')
else:
	print('NO')


(a, b, c) = [input(), input(), input()]
p = {'a', 'e', 'i', 'o', 'u'}
ans = 0
for i in a:
	if i in p:
		ans += 1
if ans != 5:
	print('NO')
	exit()
ans = 0
for i in b:
	if i in p:
		ans += 1
if ans != 7:
	print('NO')
	exit()
ans = 0
for i in c:
	if i in p:
		ans += 1
if ans != 5:
	print('NO')
	exit()
print('YES')


a = [input() for i in range(3)]
vo = ['a', 'e', 'i', 'o', 'u']
for i in range(3):
	v = 0
	for j in a[i]:
		if j in vo:
			v += 1
	if i % 2 == 0 and v != 5:
		print('NO')
		exit()
	elif i == 1 and v != 7:
		print('NO')
		exit()
print('YES')


inp1 = input()
inp2 = input()
inp3 = input()
val1 = inp1.count('a') + inp1.count('e') + inp1.count('i') + inp1.count('o') + inp1.count('u')
val2 = inp2.count('a') + inp2.count('e') + inp2.count('i') + inp2.count('o') + inp2.count('u')
val3 = inp3.count('a') + inp3.count('e') + inp3.count('i') + inp3.count('o') + inp3.count('u')
if val1 == 5 and val2 == 7 and (val3 == 5):
	print('YES')
else:
	print('NO')


import sys
from itertools import *
from cmath import *
input = sys.stdin.readline
from math import *

def inp():
	return int(input().strip())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
vowels = 'aeiou'
cnt = 0
ans = 0
s = ''
s = str(input())
for char in s:
	if char in vowels:
		cnt += 1
if cnt == 5:
	ans += 1
cnt = 0
s = str(input())
for char in s:
	if char in vowels:
		cnt += 1
if cnt == 7:
	ans += 1
cnt = 0
s = str(input())
for char in s:
	if char in vowels:
		cnt += 1
if cnt == 5:
	ans += 1
print('YES' if ans == 3 else 'NO')


vowel = ['a', 'e', 'i', 'o', 'u']
length = [5, 7, 5]
for _ in range(3):
	line = input()
	cnt = 0
	for char in line:
		if char in vowel:
			cnt += 1
	if cnt != length[_]:
		print('NO')
		exit(0)
print('YES')


from collections import Counter
vowels = ['a', 'e', 'i', 'o', 'u']
lines = []
counts = []
for i in range(3):
	lines.append(input())
for l in lines:
	summ = 0
	for v in vowels:
		summ += l.count(v)
	counts.append(summ)
if counts[0] == counts[2] == 5 and counts[1] == 7:
	print('YES')
else:
	print('NO')


def f(s, x):
	a = 0
	for i in s:
		if i in ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']:
			a += 1
	if a != x:
		return False
	return True
l = []
for i in range(3):
	s = input()
	if i == 1:
		x = 7
	else:
		x = 5
	l.append(f(s, x))
if all(l):
	print('YES')
else:
	print('NO')


l = list(input())
m = list(input())
n = list(input())
l1 = l.count('a') + l.count('e') + l.count('i') + l.count('o') + l.count('u')
l2 = m.count('a') + m.count('e') + m.count('i') + m.count('o') + m.count('u')
l3 = n.count('a') + n.count('e') + n.count('i') + n.count('o') + n.count('u')
if l1 == 5 and l2 == 7 and (l3 == 5):
	print('YES')
else:
	print('NO')


s = [0] * 3
slog = [0] * 3
for i in range(3):
	s[i] = input()
	slog[i] = s[i].count('a') + s[i].count('e') + s[i].count('i') + s[i].count('o') + s[i].count('u')
if slog[0] == 5 and slog[1] == 7 and (slog[2] == 5):
	print('YES')
else:
	print('NO')


def nihar(s):
	c = 0
	c = c + s.count('a') + s.count('e') + s.count('i') + s.count('o') + s.count('u')
	return c
s1 = input()
s2 = input()
s3 = input()
k1 = nihar(s1)
k2 = nihar(s2)
k3 = nihar(s3)
if k1 == 5 and k2 == 7 and (k3 == 5):
	print('YES')
else:
	print('NO')


v = ['a', 'e', 'i', 'o', 'u']
out = []
for z in range(3):
	c = 0
	l = list(input())
	for i in l:
		if i in v:
			c = c + 1
	out.append(c)
for i in range(3):
	if i % 2 == 0:
		if out[i] != 5:
			print('NO')
			quit()
	elif out[i] != 7:
		print('NO')
		quit()
print('YES')


count_vowels = lambda s: sum((ch in 'aeiou' for ch in s))
print('YES' if count_vowels(input()) == 5 and count_vowels(input()) == 7 and (count_vowels(input()) == 5) else 'NO')


import sys
input = sys.stdin.readline

def gint():
	return int(input())

def gint_arr():
	return list(map(int, input().split()))

def gfloat():
	return float(input())

def gfloat_arr():
	return list(map(float, input().split()))

def pair_int():
	return map(int, input().split())
INF = 1 << 31
MOD = '1000000007'
dx = [-1, 0, 1, 0]
dy = [0, 1, 0, -1]
a = input()
b = input()
c = input()
v = ['a', 'i', 'e', 'o', 'u']
cnt = [5, 7, 5]
print('YES' if [sum((a.count(x) for x in v)), sum((b.count(x) for x in v)), sum((c.count(x) for x in v))] == cnt else 'NO')


def is_haiku(a, b, c):
	count = 0
	for i in range(len(a)):
		if a[i] == 'a' or a[i] == 'e' or a[i] == 'i' or (a[i] == 'o') or (a[i] == 'u'):
			count = count + 1
			if count > 5:
				print('NO')
				return
	if count != 5:
		print('NO')
		return
	count = 0
	for i in range(len(b)):
		if b[i] == 'a' or b[i] == 'e' or b[i] == 'i' or (b[i] == 'o') or (b[i] == 'u'):
			count = count + 1
			if count > 7:
				print('NO')
				return
	if count != 7:
		print('NO')
		return
	count = 0
	for i in range(len(c)):
		if c[i] == 'a' or c[i] == 'e' or c[i] == 'i' or (c[i] == 'o') or (c[i] == 'u'):
			count = count + 1
			if count > 5:
				print('NO')
				return
	if count != 5:
		print('NO')
		return
	print('YES')
a = input('')
b = input('')
c = input('')
is_haiku(list(a), list(b), list(c))


s1 = list(input())
s2 = list(input())
s3 = list(input())
j = 0
r = 0
l = 0
for i in range(len(s1)):
	if s1[i] == 'a' or s1[i] == 'e' or s1[i] == 'i' or (s1[i] == 'o') or (s1[i] == 'u'):
		j += 1
for i in range(len(s2)):
	if s2[i] == 'a' or s2[i] == 'e' or s2[i] == 'i' or (s2[i] == 'o') or (s2[i] == 'u'):
		r += 1
for i in range(len(s3)):
	if s3[i] == 'a' or s3[i] == 'e' or s3[i] == 'i' or (s3[i] == 'o') or (s3[i] == 'u'):
		l += 1
if j != 5 or r != 7 or l != 5:
	print('NO')
	quit()
print('YES')


a = input()
b = input()
c = input()
v1 = a.count('a') + a.count('e') + a.count('i') + a.count('o') + a.count('u')
v2 = b.count('a') + b.count('e') + b.count('i') + b.count('o') + b.count('u')
v3 = c.count('a') + c.count('e') + c.count('i') + c.count('o') + c.count('u')
if v1 == 5 and v2 == 7 and (v3 == 5):
	print('YES')
else:
	print('NO')


a = input()
b = input()
c = input()
cnt1 = 0
cnt2 = 0
cnt3 = 0
for i in a:
	if i in 'aeiou':
		cnt1 += 1
for i in b:
	if i in 'aeiou':
		cnt2 += 1
for i in c:
	if i in 'aeiou':
		cnt3 += 1
if cnt1 == 5 and cnt2 == 7 and (cnt3 == 5):
	print('YES')
else:
	print('NO')


a = input()
b = input()
c = input()
asum = a.count('a') + a.count('e') + a.count('i') + a.count('o') + a.count('u')
bsum = b.count('a') + b.count('e') + b.count('i') + b.count('o') + b.count('u')
csum = c.count('a') + c.count('e') + c.count('i') + c.count('o') + c.count('u')
if asum == 5 and bsum == 7 and (csum == 5):
	print('YES')
else:
	print('NO')


def z(i):
	d = {}
	for x in 'aeiou':
		c = i.count(x)
		d[x] = c
	return sum(d.values())
print(['NO', 'YES'][z(input()) == 5 and z(input()) == 7 and (z(input()) == 5)])


a = input()
b = input()
c = input()
first = a.count('a') + a.count('e') + a.count('i') + a.count('o') + a.count('u')
second = b.count('a') + b.count('e') + b.count('i') + b.count('o') + b.count('u')
third = c.count('a') + c.count('e') + c.count('i') + c.count('o') + c.count('u')
if first == 5 and second == 7 and (third == 5):
	print('YES')
else:
	print('NO')


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x) + '\n')
a = get_string()
b = get_string()
c = get_string()
vowel = set('aeiou')
c1 = c2 = c3 = 0
for i in a:
	if i in vowel:
		c1 += 1
for i in b:
	if i in vowel:
		c2 += 1
for i in c:
	if i in vowel:
		c3 += 1
if c1 == 5 and c2 == 7 and (c3 == 5):
	print('YES')
else:
	print('NO')


def main():
	n = input().strip()
	m = input().strip()
	k = input().strip()
	l = ['a', 'e', 'i', 'o', 'u']
	x = 0
	y = 0
	z = 0
	for i in l:
		x += n.count(i)
		y += m.count(i)
		z += k.count(i)
	if x == 5 and y == 7 and (z == 5):
		print('YES')
	else:
		print('NO')
main()


x = ['a', 'e', 'i', 'o', 'u']
a = input().strip()
b = input().strip()
c = input().strip()
(m, n, o) = (0, 0, 0)
for i in range(len(a)):
	if a[i] in x:
		m += 1
for i in range(len(b)):
	if b[i] in x:
		n += 1
for i in range(len(c)):
	if c[i] in x:
		o += 1
if m == 5 and n == 7 and (o == 5):
	print('YES')
else:
	print('NO')


t1 = str(input())
t2 = str(input())
t3 = str(input())
s = 'aeiou'
t = 0
c = 0
for i in s:
	j = i
	t = t + t1.count(j)
if t == 5:
	c = c + 1
t = 0
for i in s:
	j = i
	t = t + t2.count(j)
if t == 7:
	c = c + 1
t = 0
for i in s:
	j = i
	t = t + t3.count(j)
if t == 5:
	c = c + 1
if c == 3:
	print('YES')
else:
	print('NO')


import re
a = input()
b = input()
c = input()
if len(re.findall('[aouei]', a)) == 5 and len(re.findall('[aouei]', b)) == 7 and (len(re.findall('[aouei]', c)) == 5):
	print('YES')
else:
	print('NO')


a = input()
b = input()
c = input()
gl = ['a', 'e', 'u', 'o', 'i']
sp1 = a.split(' ')
sp2 = b.split(' ')
sp3 = c.split(' ')
i = 0
ii = 0
iii = 0
for elem in sp1:
	for g in elem:
		if g.lower() in gl:
			i += 1
for elem in sp2:
	for g in elem:
		if g.lower() in gl:
			ii += 1
for elem in sp3:
	for g in elem:
		if g.lower() in gl:
			iii += 1
if i == 5 and ii == 7 and (iii == 5):
	print('YES')
else:
	print('NO')


s = input()
x = input()
y = input()
vov = 'aeiou'
cnt = 0
for c in s:
	if c in vov:
		cnt += 1
cnt2 = 0
for c in x:
	if c in vov:
		cnt2 += 1
cnt3 = 0
for c in y:
	if c in vov:
		cnt3 += 1
if cnt == 5 and cnt2 == 7 and (cnt3 == 5):
	print('YES')
else:
	print('NO')


d = {'a', 'e', 'i', 'o', 'u'}
for i in range(3):
	count = 0
	t = input()
	for j in t:
		if j in d:
			count = count + 1
	if count == 5 and i == 0 or (count == 5 and i == 2):
		continue
	elif i == 0 or i == 2:
		print('NO')
		exit()
	if count == 7 and i == 1:
		continue
	else:
		print('NO')
		exit()
print('YES')


vowels = ['a', 'i', 'o', 'u', 'e']

def solve():
	a = str(input())
	b = str(input())
	c = str(input())
	x = 0
	y = 0
	z = 0
	for i in a:
		if i in vowels:
			x = x + 1
	for i in b:
		if i in vowels:
			y = y + 1
	for i in c:
		if i in vowels:
			z = z + 1
	if x == 5 and y == 7 and (z == 5):
		print('YES')
	else:
		print('NO')
solve()


import sys
import math
import bisect
import itertools
import random
import re

def main():
	A = sys.stdin.readlines()
	B = []
	for s in A:
		val = 0
		for c in s:
			if c in 'aeiou':
				val += 1
		B.append(val)
	if B == [5, 7, 5]:
		print('YES')
	else:
		print('NO')
main()


import sys
Input = sys.stdin.readline
counterList = []
counter = 0
vowel = 'aeoui'
for i in range(3):
	s = Input()
	for j in s:
		if j in vowel:
			counter += 1
	counterList.append(counter)
	counter = 0
if counterList[0] == 5 and counterList[1] == 7 and (counterList[2] == 5):
	print('YES')
else:
	print('NO')


vowels = ['a', 'e', 'i', 'o', 'u']
s1 = input()
s2 = input()
s3 = input()
(a, b, c) = (0, 0, 0)
for i in s1:
	if i in vowels:
		a += 1
for i in s2:
	if i in vowels:
		b += 1
for i in s3:
	if i in vowels:
		c += 1
if a == 5 and b == 7 and (c == 5):
	print('YES')
else:
	print('NO')


from sys import stdin
i = 0
ans = True
c = [5, 7, 5]
v = ['a', 'e', 'i', 'o', 'u']
for line in stdin:
	if len([x for x in line if x in v]) != c[i]:
		ans = False
	i += 1
print('YES' if ans else 'NO')


k = []
m = 0
for t in range(3):
	s = input()
	s = s.lstrip()
	s = s.rstrip()
	a = s.count('a')
	e = s.count('e')
	i = s.count('i')
	o = s.count('o')
	u = s.count('u')
	if a + e + i + o + u == 5 and (t == 0 or t == 2):
		m += 1
	elif a + e + i + o + u == 7 and t == 1:
		m += 1
if m == 3:
	print('YES')
else:
	print('NO')


l = []
for i in range(3):
	l.append(input())
i = 0
k = 0
h = 0
for j in range(3):
	for i in range(len(l[j])):
		if l[j][i] == 'a' or l[j][i] == 'e' or l[j][i] == 'i' or (l[j][i] == 'o') or (l[j][i] == 'u'):
			k += 1
	if (j == 0 or j == 2) and k == 5:
		h += 1
	if j == 1 and k == 7:
		h += 1
	k = 0
if h == 3:
	print('YES')
else:
	print('NO')


a = input().replace(' ', '')
b = input().replace(' ', '')
c = input().replace(' ', '')
l = list('aeiou')
(f, d, e) = (0, 0, 0)
for i in a:
	if i in l:
		f += 1
for i in b:
	if i in l:
		d += 1
for i in c:
	if i in l:
		e += 1
if f == 5 and d == 7 and (e == 5):
	print('YES')
else:
	print('NO')