Vasya plays the sleuth with his friends. The rules of the game are as follows: those who play for the first time, that is Vasya is the sleuth, he should investigate a "crime" and find out what is happening. He can ask any questions whatsoever that can be answered with "Yes" or "No". All the rest agree beforehand to answer the questions like that: if the question’s last letter is a vowel, they answer "Yes" and if the last letter is a consonant, they answer "No". Of course, the sleuth knows nothing about it and his task is to understand that.

Unfortunately, Vasya is not very smart. After 5 hours of endless stupid questions everybody except Vasya got bored. That’s why Vasya’s friends ask you to write a program that would give answers instead of them.

The English alphabet vowels are: A, E, I, O, U, Y

The English alphabet consonants are: B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Z

Input

The single line contains a question represented by a non-empty line consisting of large and small Latin letters, spaces and a question mark. The line length does not exceed 100. It is guaranteed that the question mark occurs exactly once in the line — as the last symbol and that the line contains at least one letter.

Output

Print answer for the question in a single line: YES if the answer is "Yes", NO if the answer is "No".

Remember that in the reply to the question the last letter, not the last character counts. I. e. the spaces and the question mark do not count as letters.

Examples

Input

Is it a melon?


Output

NO


Input

Is it an apple?


Output

YES


Input

  Is     it a banana ?


Output

YES


Input

Is   it an apple  and a  banana   simultaneouSLY?


Output

YES

Difficulty: EASY

Solutions:
s = input()
for x in s:
	if x != ' ' and x != '?':
		t = x
if t in 'aeiouyAEIOUY':
	print('YES')
else:
	print('NO')


import string
s = input()
for i in range(len(s) - 1, -1, -1):
	if s[i] in string.ascii_letters:
		print('YES' if s[i].lower() in ['a', 'e', 'i', 'o', 'u', 'y'] else 'NO')
		break


s = input().upper()
gl = 'AEIOUY'
sogl = 'BCDFGHJKLMNPQRSTVWXZ'
for i in s[::-1]:
	if i in gl:
		print('YES')
		break
	elif i in sogl:
		print('NO')
		break


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
from collections import defaultdict
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')
s = input()
n = len(s)
ch = 0
a = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
for i in range(n - 1, -1, -1):
	if ord(s[i]) >= 97 and ord(s[i]) <= 122 or (ord(s[i]) >= 65 and ord(s[i]) <= 92):
		if s[i] in a:
			ch = 1
		break
if ch == 1:
	print('YES')
else:
	print('NO')


a = 'aeiouyAEIOUY'
b = input()
b = b.replace(' ', '')
if b[-2] in a:
	print('YES')
else:
	print('NO')


str = input()
bad = [' ', '?']
for i in bad:
	str = str.replace(i, '')

def fun():
	ar = []
	ar[:] = str
	vowels = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
	for x in vowels:
		if ar[len(str) - 1] == x:
			return 'YES'
	return 'NO'
print(fun())


s = input()
n = len(s)
n -= 2
flag = True
while True:
	if s[n] == ' ':
		n -= 1
	else:
		if s[n].lower() in 'aeiouy':
			flag = False
		break
if flag:
	print('NO')
else:
	print('YES')


s = input()
s = s.replace(' ', '')
l = len(s) - 2
w = ['A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y']
f = 0
for i in w:
	if i == s[l]:
		f = 0
		break
	else:
		f = 1
if f == 0:
	print('YES')
else:
	print('NO')


print('YES' if input().lower().strip(' ?')[-1] in 'aeiouy' else 'NO')


n = input()
n = n.lower()
removed = n.replace(' ', '')
c = removed[-2]
if c in 'aeiouy':
	print('YES')
else:
	print('NO')


glas = 'AEOIUY'
n = input().lower()
n = n.replace(' ', '')
if n[-2] in glas.lower():
	print('YES')
else:
	print('NO')


print('YES' if input()[:-1].split()[-1][-1] in 'aeiouyAEIOUY' else 'NO')


s = input()
s = s.replace(' ', '')
n = len(s) - 2
if s[n] == 'a' or s[n] == 'e' or s[n] == 'i' or (s[n] == 'o') or (s[n] == 'u') or (s[n] == 'y') or (s[n] == 'A') or (s[n] == 'E') or (s[n] == 'I') or (s[n] == 'O') or (s[n] == 'U') or (s[n] == 'Y'):
	print('YES')
else:
	print('NO')


S = input()
V = 'AaEeIiOoUuYy'
N = 'BbCcDdFfGgHhJjKkLlMmNnPpQqRrSsTtVvWwXxZz'
for i in range(len(S) - 1, -1, -1):
	if V.find(S[i]) != -1:
		print('YES')
		break
	if N.find(S[i]) != -1:
		print('NO')
		break


class CodeforcesTask49ASolution:

	def __init__(self):
		self.result = ''
		self.question = ''

	def read_input(self):
		self.question = input()

	def process_task(self):
		vowels = 'aeiouyAEIOUY'
		if self.question[::-1].split('?')[1].replace(' ', '')[0] in vowels:
			self.result = 'YES'
		else:
			self.result = 'NO'

	def get_result(self):
		return self.result
Solution = CodeforcesTask49ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


s = input()
s = s.replace(' ', '')
ans = set(['A', 'E', 'I', 'O', 'U', 'Y'])
print('YES' if s[-2].upper() in ans else 'NO')


l = input().replace(' ', '')
s = list(l)
n = len(s)
if len(s) > 1:
	if s[n - 2] == 'a' or s[n - 2] == 'e' or s[n - 2] == 'i' or (s[n - 2] == 'o') or (s[n - 2] == 'u') or (s[n - 2] == 'y'):
		print('YES')
	elif s[n - 2] == 'A' or s[n - 2] == 'E' or s[n - 2] == 'I' or (s[n - 2] == 'O') or (s[n - 2] == 'U') or (s[n - 2] == 'Y'):
		print('YES')
	else:
		print('NO')
exit()


n = map(str.lower, input())
a = ''
for i in n:
	if i.isalpha():
		a += i
	else:
		continue
if a[-1] == 'a' or a[-1] == 'o' or a[-1] == 'y' or (a[-1] == 'u') or (a[-1] == 'e') or (a[-1] == 'i'):
	print('YES')
else:
	print('NO')


import sys
inf = float('inf')
mod = 1000000007

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

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

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

def int1():
	return int(input())
import string
import math
from itertools import combinations

def main():
	s1 = 'aeiouyAEIOUY'
	s3 = ''
	s = input()
	for i in s:
		if i != ' ':
			s3 = s3 + i
	x = s3[-3]
	if x in s1:
		print('YES')
	else:
		print('NO')
main()


word = input().replace(' ', '')
vowel = set('oiuaeyOIUAEY')
if word[len(word) - 2] in vowel:
	print('YES')
else:
	print('NO')


def main(s):
	return 'NO' if ''.join(''.join(s.lower().strip().split(' ')).split('?'))[-1] not in set(['a', 'e', 'i', 'o', 'u', 'y']) else 'YES'
print(main(input()))


vowels = ['A', 'E', 'I', 'O', 'U', 'Y']
other = ['B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Z']

def detective(s):
	s = ''.join(s.split())
	t = s.upper()
	if t[-2] in vowels:
		return 'YES'
	if t[-2] in other:
		return 'NO'
print(detective(input()))


a = input()
m = ''.join(a.split())
if m[-2] == 'a' or m[-2] == 'A' or m[-2] == 'e' or (m[-2] == 'E') or (m[-2] == 'i') or (m[-2] == 'I') or (m[-2] == 'o') or (m[-2] == 'O') or (m[-2] == 'u') or (m[-2] == 'U') or (m[-2] == 'y') or (m[-2] == 'Y'):
	print('YES')
else:
	print('NO')


n = input().strip('?')
n = n.split()
a = list(n[len(n) - 1])
l = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
flag = 0
for i in range(len(l)):
	if a[len(a) - 1] == l[i]:
		flag = 1
		print('YES')
		break
if flag == 0:
	print('NO')


s = input().lower()
i = len(s) - 1
while not ord('a') <= ord(s[i]) <= ord('z'):
	i -= 1
ans = 'NO'
if s[i] in ['a', 'e', 'i', 'o', 'u', 'y']:
	ans = 'YES'
print(ans)


a = list(map(str, input()))
s = 'aeiouyAEIOUY'
i = -2
while a[i] == ' ':
	i -= 1
print('YES' if a[i] in s else 'NO')


b = list(input().split())
c = b[-1]
d = 'AEIOUY'
d1 = 'aeiouy'
if c == '?':
	c = b[-2]
	if c[-1] in d or c[-1] in d1:
		print('YES')
	else:
		print('NO')
elif c[-2] in d or c[-2] in d1:
	print('YES')
else:
	print('NO')


def solve(a):
	while a[-1] in [' ', '?']:
		a = a[:-1]
	if a[-1] in ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U', 'y', 'Y']:
		return 'YES'
	return 'NO'
a = input()
print(solve(a))


vowels = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
(question, pure_word) = (input(), '')
question = question.split()
for t in question:
	pure_word += t
if pure_word[-2] in vowels:
	print('YES')
else:
	print('NO')


def self():
	a = input()
	f = ['A', 'E', 'I', 'O', 'U', 'Y']
	d = ['a', 'e', 'i', 'o', 'u', 'y']
	j = -2
	while a[j] == ' ':
		j -= 1
	if a[j].islower():
		if a[j] not in d:
			print('NO')
			exit()
		else:
			print('YES')
			exit()
	elif a[j] not in f:
		print('NO')
		exit()
	else:
		print('YES')
		exit()
self()


vowel = ['a', 'e', 'i', 'o', 'u', 'y']
s = list(input())
s.reverse()
for i in s:
	if i.isalpha():
		if i.lower() in vowel:
			print('YES')
			break
		else:
			print('NO')
			break
	else:
		continue


s = input().split()
if s[-1] == '?':
	alpha = s[-2][-1]
	alpha = alpha.lower()
	if alpha == 'a' or alpha == 'e' or alpha == 'i' or (alpha == 'o') or (alpha == 'u') or (alpha == 'y'):
		print('YES')
	else:
		print('NO')
else:
	alpha = s[-1][-2]
	alpha = alpha.lower()
	if alpha == 'a' or alpha == 'e' or alpha == 'i' or (alpha == 'o') or (alpha == 'u') or (alpha == 'y'):
		print('YES')
	else:
		print('NO')


a = input()
a = a.replace(' ', '')
l = ['a', 'e', 'i', 'o', 'u', 'y']
if a[-2].lower() in l:
	print('yes'.upper())
else:
	print('no'.upper())


from math import ceil, floor, sqrt, log, gcd

def solve():
	S = input()
	while S[-1] == ' ' or S[-1] == '?':
		S = S[:-1]
	S = S.lower()
	if S[-1] == 'a' or S[-1] == 'e' or S[-1] == 'i' or (S[-1] == 'o') or (S[-1] == 'u') or (S[-1] == 'y'):
		print('YES')
	else:
		print('NO')
T = 1
for _ in range(T):
	solve()


s = input().lower()
s = s.replace(' ', '')
last = s[len(s) - 1]
if last == '?' or last == ' ':
	last = s[len(s) - 2]
if last == 'a' or last == 'e' or last == 'i' or (last == 'o') or (last == 'u') or (last == 'y'):
	print('YES')
else:
	print('NO')


x = [l for l in input().upper() if l != ' ' and l != '?'][-1] in ['A', 'E', 'I', 'O', 'U', 'Y']
print('YES' if x else 'NO')


s = input().replace(' ', '')
vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U', 'y', 'Y']
s1 = list(s)
n = len(s1)
if s1[n - 2] in vowels:
	print('YES')
else:
	print('NO')


s = input()
s = s[::-1]
v = ['A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y']
for i in range(len(s)):
	if s[i] != ' ' and s[i] != '?':
		if s[i] in v:
			print('YES')
		else:
			print('NO')
		break


l = list(map(str, input().split()))
c = ['e', 'y', 'u', 'i', 'o', 'a', 'E', 'Y', 'U', 'I', 'O', 'A']
if l[-1] == '?':
	del l[-1]
	if l[-1][-1] in c:
		print('YES')
	else:
		print('NO')
elif l[-1][-2] in c:
	print('YES')
else:
	print('NO')


s = input()
s.split()

def last(p):
	for i in range(len(p) - 1, -1, -1):
		x = p[i]
		if x != '?' and x != ' ':
			return x
a = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'U', 'O', 'y', 'Y']
t = last(s)
if t in a:
	print('YES')
else:
	print('NO')


inp = input().lower()
vowels = ['a', 'e', 'i', 'o', 'u', 'y']
inp = inp.replace(' ', '')
if inp[-2] in vowels:
	print('YES')
else:
	print('NO')


n = input().split()
if n == ' ':
	print('NO')
	exit()
if n[-1] == '?':
	if n[-2][-1] in 'aeiouyAEIOUY':
		print('YES')
		exit()
elif n[-1][-1] == '?':
	if n[-1][-2] in 'aeiouyAEIOUY':
		print('YES')
		exit()
print('NO')


from string import punctuation

def strip_punctuation(s):
	return ''.join((c for c in s if c not in punctuation))
n = input()
n = strip_punctuation(n)
n = n.replace(' ', '').lower()
if n[-1] == 'a' or n[-1] == 'o' or n[-1] == 'i' or (n[-1] == 'e') or (n[-1] == 'u') or (n[-1] == 'y'):
	print('YES')
else:
	print('NO')


s = input()
d = {'A': 0, 'E': 0, 'I': 0, 'O': 0, 'U': 0, 'Y': 0, 'a': 0, 'e': 0, 'o': 0, 'i': 0, 'u': 0, 'y': 0}
for i in range(len(s) - 1, -1, -1):
	if s[i].isalpha():
		e = s[i]
		break
if e in d:
	print('YES')
else:
	print('NO')


x = [str(x) for x in input().split()]
if x[-1] == '?':
	if x[-2][-1] == 'A' or x[-2][-1] == 'a' or x[-2][-1] == 'E' or (x[-2][-1] == 'e') or (x[-2][-1] == 'I') or (x[-2][-1] == 'i') or (x[-2][-1] == 'O') or (x[-2][-1] == 'o') or (x[-2][-1] == 'U') or (x[-2][-1] == 'u') or (x[-2][-1] == 'Y') or (x[-2][-1] == 'y'):
		print('YES')
	else:
		print('NO')
elif x[-1] != '?':
	if x[-1][-2] == 'A' or x[-1][-2] == 'a' or x[-1][-2] == 'E' or (x[-1][-2] == 'e') or (x[-1][-2] == 'I') or (x[-1][-2] == 'i') or (x[-1][-2] == 'O') or (x[-1][-2] == 'o') or (x[-1][-2] == 'U') or (x[-1][-2] == 'u') or (x[-1][-2] == 'Y') or (x[-1][-2] == 'y'):
		print('YES')
	else:
		print('NO')


s = input()
alth = 'aeiouyAEYUIO'
j = 0
for i in range(len(s) - 1, -1, -1):
	if ' ?'.find(s[i]) == -1:
		j = i
		break
ans = alth.find(s[j]) != -1
print('YES' * ans + 'NO' * (1 - ans))


s = input()
i = len(s) - 1
while s[i] == ' ' or s[i] == '?':
	i -= 1
if s[i].upper() in ['A', 'E', 'I', 'O', 'U', 'Y']:
	print('YES')
else:
	print('NO')


print(('NO', 'YES')[input()[:-1].rstrip().lower()[-1] in set('aeiouy')])


st = list(input().split())
p = False
vowel = 'aeiouy'
st1 = st[-1]
if st1 == '?':
	st1 = st[-2]
st1 = st1.lower()
s = st1[-1]
if s == '?':
	s = st1[-2]
for i in vowel:
	if i == s:
		p = True
		break
if p:
	print('YES')
else:
	print('NO')


def isvowel(c):
	return c.lower() in ['a', 'e', 'i', 'o', 'u', 'y']
s = input()
for x in s[-2::-1]:
	if x.isalpha():
		if isvowel(x):
			print('YES')
		else:
			print('NO')
		break


import re
s = input()
l = []
f = 0
l = re.split(' |,|\\?|,| ', s)
for i in l:
	if len(i) > 0:
		if i[len(i) - 1] in 'AEIUOYaeiouy':
			f = 1
		else:
			f = 0
if f == 1:
	print('YES')
else:
	print('NO')


v = ['a', 'e', 'i', 'o', 'u', 'y']
s = input()
s = s[:-1]
s = s.strip()
print('YES' if s[-1].lower() in v else 'NO')


a = input()
a = a[::-1]
for i in a:
	if i == '?' or i == ' ':
		continue
	elif i.lower() in ['a', 'e', 'i', 'o', 'u', 'y']:
		print('YES')
		break
	else:
		print('NO')
		break


n = input()
z = []
for i in n:
	z.append(i)
z.remove('?')
m = ''
for j in z:
	m = m + j
m = m.strip()
m = m.lower()
if m[len(m) - 1] in 'euioay':
	print('YES')
else:
	print('NO')


a = input()
vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U', 'y', 'Y']
l = len(a) - 1
while a[l] == ' ' or a[l] == '?':
	l -= 1
char = a[l]
if char in vowels:
	print('YES')
else:
	print('NO')


s = input().strip().split()
v = ['A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y']
b = []
for i in s:
	if i != '?':
		b.append(i)
x = b[-1]
if '?' in x:
	y = x[-2]
else:
	y = x[-1]
if y in v:
	print('YES')
else:
	print('NO')


str = input().lower()
lst = []
al = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(str)):
	if str[i] in al:
		lst.append(str[i])
vo = 'aeiouy'
if lst[-1] in vo:
	print('YES')
else:
	print('NO')


s = input()
c = len(s) - 1
fr1 = c
for fr1 in range(c, -1, -1):
	if s[fr1].upper() == 'A' or s[fr1].upper() == 'E' or s[fr1].upper() == 'I' or (s[fr1].upper() == 'O') or (s[fr1].upper() == 'U') or (s[fr1].upper() == 'Y'):
		print('YES')
		exit()
	elif s[fr1].isalpha():
		print('NO')
		exit()


def fil(a):
	if a.isalpha and a != ' ':
		return True
	else:
		return False
a = input()
line = [l for l in a]
line = list(filter(fil, line))
if line[-2] in 'aeiouyAEIOUY':
	print('YES')
else:
	print('NO')


print('YES' if input().replace(' ', '').casefold()[-2] in ['a', 'e', 'i', 'o', 'u', 'y'] else 'NO')


s = input()
l = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
g = len(s) * -1
for i in range(-1, g - 1, -1):
	if 64 < ord(s[i]) < 91 or 96 < ord(s[i]) < 123:
		if s[i] in l:
			print('YES')
			break
		else:
			print('NO')
			break


q = input().lower()
q = q.replace(' ', '').replace('?', '')
if 'simultaneously' in q:
	q.replace('simultaneously', '')
if q[-1] in ['a', 'e', 'i', 'o', 'u', 'y']:
	print('YES')
else:
	print('NO')


n = input().split('?')
n = ''.join(n)
n = n.strip()
n = list(n)
x = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U', 'y', 'Y']
if n[-1] in x:
	print('YES')
else:
	print('NO')


a = input().split()
vow = list('aeiouyAEIOUY')
l = []
for i in a:
	if i:
		l.append(i)
if len(l[-1]) > 1:
	if l[-1][-2] in vow:
		print('YES')
	else:
		print('NO')
elif l[-2][-1] in vow:
	print('YES')
else:
	print('NO')


t = input()
i = len(t) - 2
while t[i] == ' ':
	i -= 1
print('YNEOS'[not t[i] in 'aeiouyAEIOUY'::2])


ans = ''.join(input().strip().split())[-2]
print('YES' if ans in 'AaEeIiOoUuYy' else 'NO')


n = list(input().split())
l1 = ['A', 'E', 'I', 'O', 'U', 'Y']
if n[-1] != '?':
	if n[-1][-2].upper() in l1:
		print('YES')
	else:
		print('NO')
elif n[-2][-1].upper() in l1:
	print('YES')
else:
	print('NO')


s = input().lower().rstrip('?').strip()
print('YNEOS'[s[len(s) - 1] not in 'aeiouy'::2])


__author__ = 'Dilshod'
s = input()
s = s.lower()
s = s.split()
letters = 'abcdefghijklmnopqrstuvwxyz'
vovel = 'aeiouy'
a = ''
for i in s:
	a += i
if a[-1] not in letters:
	a = a[:-1]
if a[-1] in vovel:
	print('YES')
else:
	print('NO')


V = list('aeiouy')
C = list('bcdefghjklmnpqrstvwxyz')
a = input()
for i in reversed(a.lower()):
	if i in V:
		print('YES')
		break
	elif i in C:
		print('NO')
		break


vow = 'aeiouy'
s = input()
for i in s[::-1]:
	if i.isalpha():
		if i.lower() in vow:
			print('YES')
		else:
			print('NO')
		break


s = input()
a = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
s = s.replace('?', '')
s = list(s.strip().split(' '))
if s[-1][-1] in a:
	print('YES')
else:
	print('NO')


from sys import stdin, stdout
from collections import *
from math import ceil, floor, log, gcd
st = lambda : list(stdin.readline().strip())
li = lambda : list(map(int, stdin.readline().split()))
mp = lambda : map(int, stdin.readline().split())
inp = lambda : int(stdin.readline())
pr = lambda n: stdout.write(str(n) + '\n')
mod = 1000000007
INF = float('inf')

def solve():
	s = input().lstrip().rstrip().split()
	i = len(s) - 1
	while i >= 0:
		x = s[i]
		for j in range(len(x) - 1, -1, -1):
			if x[j].isalpha():
				p = x[j].lower()
				if p in 'aeiouy':
					pr('YES')
					return
				else:
					pr('NO')
					return
		i -= 1
for _ in range(1):
	solve()


a = list(map(str, input().split()))
v = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
if a[len(a) - 1] == '?':
	b = list(map(str, a[len(a) - 2]))
	if b[len(b) - 1] in v:
		print('YES')
	else:
		print('NO')
else:
	b = list(map(str, a[len(a) - 1]))
	if b[len(b) - 2] in v:
		print('YES')
	else:
		print('NO')


def is_vowel(char):
	all_vowels = 'aeiouyAEIOUY'
	return char in all_vowels
x = input()
for i in x[::-1]:
	if i != '?' and i != ' ':
		a = i
		break
print('YES' if is_vowel(a) else 'NO')


s = str(input())
s = s.replace('?', '')
s = s.replace(' ', '')
d = s[len(s) - 1]
if d in 'aeiouy' or d in 'AEIUOY':
	print('YES')
else:
	print('NO')


a = input().strip()
a = a.replace(' ', '')
vowels = ['A', 'E', 'I', 'O', 'U', 'Y']
if a[-2].upper() in vowels:
	print('YES')
else:
	print('NO')


vowels = ['A', 'E', 'I', 'O', 'U', 'Y']
N = input()
for _ in range(len(N) - 2, -1, -1):
	if N[_] != ' ':
		print('YES' if N[_] in vowels or chr(ord(N[_]) - 32) in vowels or chr(ord(N[_]) + 32) in vowels else 'NO')
		exit()


n = input()
line = n.replace(' ', '')
low = line.lower()
vowels = ['a', 'e', 'i', 'o', 'u', 'y']
letter = low[-2]
res = ''
for i in vowels:
	if i == letter:
		res = 'YES'
		break
	else:
		res = 'NO'
print(res)


a = str(input())
a = a.strip(' ').strip('?').strip(' ')
a = a.casefold()
if a[-1] == 'a' or a[-1] == 'e' or a[-1] == 'i' or (a[-1] == 'o') or (a[-1] == 'u') or (a[-1] == 'y'):
	print('YES')
else:
	print('NO')


a = list(input())
while a.count(' ') != 0:
	a.remove(' ')
l = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
if a[-2] in l:
	print('YES')
else:
	print('NO')


x = input()
y = x.strip(' ?')

def a1():
	p = y[len(y) - 1]
	if p == 'a' or p == 'e' or p == 'i' or (p == 'o') or (p == 'u') or (p == 'A') or (p == 'O') or (p == 'I') or (p == 'E') or (p == 'U') or (p == 'y') or (p == 'Y'):
		print('YES')
	else:
		print('NO')
a1()


g = str(input())
s = g.lower()
x = ''
for i in range(0, len(s), 1):
	if 97 <= ord(s[i]) and ord(s[i]) <= 122:
		x = s[i]
if x == 'a' or x == 'e' or x == 'i' or (x == 'o') or (x == 'u') or (x == 'y'):
	print('YES')
else:
	print('NO')


s = input()
s = s[::-1]
s = s[1:]
s = s.strip()
v = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
if s[0] in v:
	print('YES')
else:
	print('NO')


s = input().split(' ')
x = ''
z = 'AEIOUYaeiouy'
for i in s:
	x += i
if x[-2] in z:
	print('YES')
else:
	print('NO')


s = input().split('?')[0].rstrip()
if s[-1].upper() in ['A', 'E', 'I', 'O', 'U', 'Y']:
	print('YES')
else:
	print('NO')


import os
import sys
from io import BytesIO, IOBase
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')

def main():
	pass

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def lts(l):
	s = ''.join(map(str, l))
	return s

def stl(s):
	l = list(s)
	return l

def sq(a, target, arr=[]):
	s = sum(arr)
	if s == target:
		return arr
	if s >= target:
		return
	for i in range(len(a)):
		n = a[i]
		remaining = a[i + 1:]
		ans = sq(remaining, target, arr + [n])
		if ans:
			return ans

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

def nCr(n, r):
	f = math.factorial
	return f(n) // f(r) // f(n - r)
mod = int(1000000000.0) + 7
import math
s = list(input().lower())
last = ''
for c in s:
	if c == '?':
		if last in {'a', 'e', 'i', 'o', 'u', 'y'}:
			print('YES')
		else:
			print('NO')
		break
	if c != ' ':
		last = c


print('NYOE S'[input()[:-1].rstrip()[-1] in 'aeiouyAEIOUY'::2])


from sys import stdin, stdout
str1 = stdin.readline().strip()
str1 = str1.replace(' ', '')
print('YES' if str1[-2].upper() in ['A', 'E', 'I', 'O', 'U', 'Y'] else 'NO')


s = input()
u = 'aeiouyAEIOUY'
s = s.replace(' ', '')
if s[-2] != ' ' and s[-2] in u:
	print('YES')
else:
	print('NO')


s = str(input())
for i in range(len(s) - 1, -1, -1):
	if s[i] in {'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z', 'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Z'}:
		print('NO')
		break
	elif s[i] in {'a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y'}:
		print('YES')
		break


def main():
	from re import sub
	question = sub('[\\s?]', '', input()).upper()
	last_char = question[-1]
	print('YES' if last_char in 'AEIOUY' else 'NO')
main()


s = input()
s = s.replace(' ', '')
s = s.replace('?', '')
if s[-1].lower() in ['a', 'e', 'i', 'o', 'u', 'y']:
	print('YES')
else:
	print('NO')


que = str(input())
for i in que[::-1]:
	if i.isspace():
		continue
	elif i == '?':
		continue
	elif i in ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']:
		print('YES')
		break
	else:
		print('NO')
		break


q = input().strip('? ').lower()
if q[-1] in ['a', 'e', 'i', 'o', 'u', 'y']:
	print('YES')
else:
	print('NO')


line = list(input())
vowels = ['A', 'E', 'I', 'O', 'U', 'Y']
while not line[-1].isalpha():
	line.pop(-1)
k = line[-1]
k = k.upper()
if k in vowels:
	print('YES')
else:
	print('NO')


A = {'a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y'}
a = input()
for i in range(len(a) - 1, -1, -1):
	if ord('A') <= ord(a[i]) <= ord('Z') or ord('a') <= ord(a[i]) <= ord('z'):
		if a[i] in A:
			print('YES')
			break
		else:
			print('NO')
			break


n = input().rstrip('?').strip()
a = ['A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y']
if n[-1] in a:
	print('YES')
else:
	print('NO')


s = input().split()
if len(s) == 1:
	s = s[0]
else:
	s = s[-2] + s[-1]
if s[-2] == 'e' or s[-2] == 'i' or s[-2] == 'o' or (s[-2] == 'u') or (s[-2] == 'a') or (s[-2] == 'y') or (s[-2] == 'A') or (s[-2] == 'E') or (s[-2] == 'I') or (s[-2] == 'O') or (s[-2] == 'U') or (s[-2] == 'Y'):
	print('YES')
else:
	print('NO')


vovels = ('A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y')
consonants = ('B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Z', 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'z')
n = input().replace(' ', '')
last = n[len(n) - 2]
if last in vovels:
	print('YES')
else:
	print('NO')


a = str(input())
x = ['a', 'o', 'u', 'e', 'i', 'u', 'A', 'O', 'U', 'I', 'E', 'Y']
s = a[-1::-1]
s = list(s)
for i in s:
	if 65 <= ord(i) <= 90 or 97 <= ord(i) <= 122:
		if i in x:
			print('YES')
			exit()
		else:
			print('NO')
			exit()


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():
	s = S()
	l = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
	s = list(s)
	while s:
		x = s.pop()
		if x in [' ', '?']:
			continue
		if x in l:
			return 'YES'
		else:
			return 'NO'
	return 'NO'
print(main())


s = str(input()).lower()
v = ['a', 'e', 'i', 'o', 'u', 'y']
for ch in reversed(s):
	if ch not in [' ', '?']:
		if ch in v:
			print('YES')
		else:
			print('NO')
		break


s = input()
s = s.replace(' ', '')
s = s.replace('?', '')
x = s[len(s) - 1]
q = {'A', 'E', 'I', 'O', 'U', 'Y'}
if x.upper() in q:
	print('YES')
else:
	print('NO')


p = input().strip()
v = ['a', 'i', 'e', 'o', 'u', 'y']
p = list(p)
p.remove('?')
p = ''.join(p)
p = p.strip()
p = p.lower()
p = p.split()
if p[len(p) - 1][len(p[len(p) - 1]) - 1] not in v:
	print('NO')
else:
	print('YES')


s = str(input())
n = len(s)
i = n - 2
while i >= 0:
	if s[i] != ' ':
		r = s[i]
		break
	else:
		i = i - 1
if r == 'A' or r == 'E' or r == 'I' or (r == 'O') or (r == 'U') or (r == 'Y'):
	print('YES')
elif r == 'a' or r == 'e' or r == 'i' or (r == 'o') or (r == 'u') or (r == 'y'):
	print('YES')
else:
	print('NO')


print('YES' if input().lower().replace(' ', '')[-2] in 'aeiuoy' else 'NO')


s = input()
l = len(s)
s = s[::-1]
for i in range(1, l):
	if s[i] != ' ':
		if s[i] == 'a' or s[i] == 'e' or s[i] == 'i' or (s[i] == 'o') or (s[i] == 'u') or (s[i] == 'y') or (s[i] == 'A') or (s[i] == 'E') or (s[i] == 'I') or (s[i] == 'O') or (s[i] == 'U') or (s[i] == 'Y'):
			print('YES')
			break
		else:
			print('NO')
			break
	else:
		continue


c = ['a', 'e', 'i', 'o', 'u', 'y']
n = input()
b = n.index('?')
while n[b - 1] == ' ':
	b -= 1
if n[b - 1].lower() in c:
	print('YES')
else:
	print('NO')


s = input()
vowel = 'aeiouy'
for i in range(len(s) - 1, -1, -1):
	if s[i].isalpha():
		if s[i].lower() in vowel:
			print('YES')
		else:
			print('NO')
		break


(a, i) = (list(reversed(list(input().lower()))), 0)
while a[i] == '?' or a[i] == ' ':
	i += 1
print('YES' if a[i] in 'aiueyo' else 'NO')


quest = list(input().upper())
i = len(quest)
allsymb = ['A', 'E', 'I', 'O', 'U', 'Y', 'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Z']
glas = ['A', 'E', 'I', 'O', 'U', 'Y']
sogl = ['B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Z']
flag = 0
while i > 0:
	if quest[i - 1] in allsymb:
		if quest[i - 1] in glas:
			print('YES')
			break
		else:
			print('NO')
			break
	i -= 1


L = list(input())
for i in range(len(L) - 1, -1, -1):
	if L[i] != '?' and L[i] != ' ':
		if L[i] == 'e' or L[i] == 'E' or L[i] == 'O' or (L[i] == 'o') or (L[i] == 'U') or (L[i] == 'u') or (L[i] == 'A') or (L[i] == 'a') or (L[i] == 'Y') or (L[i] == 'y') or (L[i] == 'i') or (L[i] == 'I'):
			print('YES')
		else:
			print('NO')
		break


s = input()
k = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'O', 'I', 'U', 'Y']
p = []
for i in range(len(s)):
	if s[i] != ' ':
		p.append(i)
try:
	if s[p[-2]] in k:
		print('YES')
	else:
		print('NO')
except:
	print('NO')


a = input()
s = []
for i in range(len(a)):
	s.append(a[i])
for i in range(s.count(' ')):
	s.remove(' ')
for i in range(s.count('?')):
	s.remove('?')
if s[len(s) - 1] == 'A' or s[len(s) - 1] == ' E' or s[len(s) - 1] == 'I' or (s[len(s) - 1] == 'O') or (s[len(s) - 1] == 'U') or (s[len(s) - 1] == 'Y'):
	print('YES')
elif s[len(s) - 1] == 'a' or s[len(s) - 1] == 'e' or s[len(s) - 1] == 'i' or (s[len(s) - 1] == 'o') or (s[len(s) - 1] == 'u') or (s[len(s) - 1] == 'y'):
	print('YES')
else:
	print('NO')


t = list(input().split())
b = ('a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U', 'Y', 'y')
if len(t[-1]) == 1:
	if t[-2][-1] in b:
		print('YES')
	else:
		print('NO')
elif t[-1][-2] in b:
	print('YES')
else:
	print('NO')


s = input().rstrip()
s = s[:len(s) - 1].rstrip()
vowels = 'aAeEIiOoUuYy'
print('YES' if s[len(s) - 1] in vowels else 'NO')


import string
inp = list(input().upper())
while inp[-1] not in string.ascii_uppercase:
	inp.pop()
if inp[-1] in 'AEIOUY':
	print('YES')
else:
	print('NO')


import sys
import math
st = sys.stdin.readline()
l = len(st) - 1
s = st[l]
while not s.isalpha():
	l -= 1
	s = st[l]
t = s.upper()
if t == 'A' or t == 'E' or t == 'I' or (t == 'O') or (t == 'U') or (t == 'Y'):
	print('YES')
else:
	print('NO')


import os
import sys
debug = True
if debug and os.path.exists('input.in'):
	input = open('input.in', 'r').readline
else:
	debug = False
	input = sys.stdin.readline

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

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

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

def invr():
	return map(int, input().split())
test_count = 1
if debug:
	test_count = inp()
for t in range(test_count):
	if debug:
		print('Test Case #', t + 1)
	x = input().strip()
	x = x[0:len(x) - 1].strip()
	if x[-1].lower() in ('a', 'i', 'e', 'o', 'u', 'y'):
		print('YES')
	else:
		print('NO')


a = input().replace(' ', '')
print('YES' if a.strip().lower()[-2] in 'aeiouy' else 'NO')


a = input()
for i in a[::-1]:
	if i.isalpha():
		if i.lower() in ['a', 'e', 'i', 'o', 'u', 'y']:
			print('YES')
		else:
			print('NO')
		break


vowels = 'AEIOUY'
q = input()
l = ''
for i in q:
	if i.isalpha():
		l = i
if l.upper() in vowels:
	print('YES')
else:
	print('NO')


from string import ascii_letters

def solve(s):
	s = s.lower()
	cons = set(ascii_letters) - set(list('aeiouy'))
	for i in reversed(s):
		if i in 'aeiouy':
			return 'YES'
		elif i in cons:
			return 'NO'

def main():
	s = input()
	print(solve(s))
main()


s = input()
import string
a = 'aeiouy'
b = 'AEIOUY'
for i in range(len(s) - 2, -1, -1):
	if s[i].isalpha():
		if s[i] in a or s[i] in b:
			print('YES')
			break
		else:
			print('NO')
			break


k = input().lower()
v = 'aeiouy'
k = k.replace(' ', '')
if k[-2] in v:
	print('YES')
else:
	print('NO')


def isvowel(x):
	return x == 'a' or x == 'e' or x == 'i' or (x == 'u') or (x == 'y') or (x == 'o')
s = input()
s.lower()
l = list(str(s.lower()))
while ' ' in l:
	l.remove(' ')
del l[-1]
if isvowel(l[-1]) == True:
	print('YES')
else:
	print('NO')


def func(c):
	if c == 'a' or c == 'e' or c == 'i' or (c == 'o') or (c == 'u') or (c == 'y') or (c == 'A') or (c == 'E') or (c == 'I') or (c == 'O') or (c == 'U') or (c == 'Y'):
		return 1
	return 0
c = input().split('?')[0].split()[-1][-1]
if func(c):
	print('YES')
else:
	print('NO')


s = input()
l = len(s)
vowel = ['a', 'e', 'i', 'o', 'u', 'y']
for i in range(2, l + 2):
	if s[l - i] != ' ':
		m = s[l - i].lower()
		break
if m in vowel:
	print('YES')
else:
	print('NO')


l = ['A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y']
x = input()
i = x.index('?') - 1
while x[i] == ' ':
	i -= 1
	if x[i] != ' ':
		break
if x[i] in l:
	print('YES')
else:
	print('NO')


s = input()
x = ''
for i in s:
	t = ord(i)
	if 64 < t and t < 91 or (96 < t and t < 123):
		x = t
if x == 65 or x == 97 or x == 69 or (x == 101) or (x == 73) or (x == 105) or (x == 79) or (x == 111) or (x == 85) or (x == 117) or (x == 89) or (x == 121):
	print('YES')
else:
	print('NO')


line = input().split()
if line[-1] == '?':
	end = line[-2]
else:
	end = line[-1][:len(line[-1]) - 1]
if end[-1].lower() in 'aeiouy':
	print('YES')
else:
	print('NO')


s = input()
t = 'aeiouy'
i = len(s) - 1
while i >= 0 and (s[i] == '?' or s[i] == ' '):
	i -= 1
if s[i].lower() in t:
	print('YES')
else:
	print('NO')


n = input()
n = n.replace('?', '')
n = n.split()
l = ['A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y']
if n[-1][-1] in l:
	print('YES')
else:
	print('NO')


s = [*map(str, input().split())]
tol = len(s)
if s[tol - 1] == '?':
	print('YES' if s[tol - 2][-1] in 'aeiouyAEIOUY' else 'NO')
else:
	print('YES' if s[tol - 1][-2] in 'aeiouyAEIOUY' else 'NO')


print('YES' if input().rstrip('?').rstrip(' ')[-1].lower() in ['a', 'e', 'i', 'o', 'u', 'y'] else 'NO')


import sys
vowel = 'AEIOUYaeiouy'
s = input()
for i in range(len(s) - 1, -1, -1):
	if s[i] != '?' and s[i] != ' ':
		if s[i] in vowel:
			print('YES')
		else:
			print('NO')
		sys.exit(0)


s = input()
s = s.lower().replace(' ', '')
if s[-2] in 'aeiouy':
	print('YES')
else:
	print('NO')


s = input()
l = len(s)
i = l - 1
while i >= 0:
	if s[i] >= 'a' and s[i] <= 'z':
		if s[i] == 'a' or s[i] == 'e' or s[i] == 'i' or (s[i] == 'o') or (s[i] == 'u') or (s[i] == 'y'):
			print('YES')
		else:
			print('NO')
		break
	elif s[i] >= 'A' and s[i] <= 'Z':
		if s[i] == 'A' or s[i] == 'E' or s[i] == 'I' or (s[i] == 'O') or (s[i] == 'U') or (s[i] == 'Y'):
			print('YES')
		else:
			print('NO')
		break
	i = i - 1


s = input()
s.replace('?', '')
s = ' '.join(s).split()
t = s[-2].lower()
if t == 'a' or t == 'e' or t == 'i' or (t == 'o') or (t == 'u') or (t == 'y'):
	print('YES')
else:
	print('NO')


m = input()
b = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
for x in range(-2, -len(m) - 1, -1):
	if m[x] != ' ':
		if m[x] in b:
			print('YES')
		else:
			print('NO')
		break


n = input().lower()
l = 'abcdefghijklmnopqrstuvwxyz'
temp = ''
v = 'aeiouy'
for i in n:
	if i in l:
		temp += i
if temp[-1] in v:
	print('YES')
else:
	print('NO')


s = input()
for i in range(len(s) - 1, -1, -1):
	if s[i].isalpha():
		break
if s[i].upper() in ['A', 'E', 'I', 'O', 'U', 'Y']:
	print('YES')
else:
	print('NO')


question = input()
dic = {'A': 1, 'E': 1, 'I': 1, 'O': 1, 'U': 1, 'Y': 1, 'a': 1, 'e': 1, 'i': 1, 'o': 1, 'u': 1, 'y': 1}
i = len(question) - 2
while question[i] == ' ' and i >= 0:
	i -= 1
if i >= 0:
	if question[i] in dic:
		print('YES')
	else:
		print('NO')


s = input()
s = s.lower()
s = s.split()
if s[-1] == '?':
	if s[-2][-1] in 'aeiouy':
		print('YES')
	else:
		print('NO')
elif s[-1][-2] in 'aeiouy':
	print('YES')
else:
	print('NO')


l = input()
c = l[:-1].strip().upper()[-1]
if c in ['A', 'E', 'I', 'O', 'U', 'Y']:
	print('YES')
else:
	print('NO')


s = input().split()
l = [i for i in s]
k = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U', 'Y', 'y']
x = list(map(chr, range(65, 91)))
y = list(map(chr, range(97, 123)))
x = x + y
j = ''.join(l)
z = [i for i in j if i in x]
m = ''.join(z)
if m[-1] in k:
	print('YES')
else:
	print('NO')


a = input()
for i in range(len(a) - 1, -1, -1):
	if a[i] in 'AEIOUYaeiouy':
		print('YES')
		break
	elif a[i] in 'BCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz':
		print('NO')
		break


question = input()
vowels = 'AEIOUY'

def get_last_char(quest):
	if quest[::-1][0].isalpha():
		return quest[::-1][0]
	return get_last_char(quest[:-1])
if get_last_char(question).upper() in vowels:
	print('YES')
else:
	print('NO')


s = input().strip('?')
s = s.strip()
s = s.lower()
if s[len(s) - 1] in 'aeiouyAEIOUY':
	print('YES')
else:
	print('NO')


f1 = ['A', 'E', 'I', 'O', 'U', 'Y']
f2 = '?'
s = input().upper().strip()
n = len(s) - 1
if s[-1] == f2:
	s = s.replace(s[-1], '', 1)
if s[-1] == ' ':
	s = s.replace(' ', '', 1)
s = s.strip()
if s[-1] in f1:
	print('YES')
else:
	print('NO')


a = input()
a = a.lower()
a = list(a)
for i in range(len(a) - 1, -1, -1):
	c = ord(a[i])
	if c >= 97 and c <= 122 or (c >= 65 and c <= 90):
		if a[i] in ['a', 'e', 'i', 'o', 'u', 'y']:
			print('YES')
			break
		else:
			print('NO')
			break


stri = list(filter(lambda x: x.isalnum(), input().strip()))
vowe = ['a', 'e', 'i', 'o', 'u', 'y']
if stri[-1].lower() in vowe:
	print('YES')
else:
	print('NO')


s = input().lower()
i = 0
c = ''
vowels = ['a', 'e', 'i', 'o', 'u', 'y']
while i < len(s):
	if s[i] != ' ' and s[i] != '?':
		c = s[i]
	i += 1
if c in vowels:
	print('YES')
else:
	print('NO')


l = list(input())
s = ['a', 'e', 'u', 'i', 'o', 'y']
p = len(l)
for i in range(p - 1, -1, -1):
	if l[i] == '?':
		continue
	elif l[i] == ' ':
		continue
	else:
		n = l[i].lower()
		if n in s:
			print('YES')
			break
		else:
			print('NO')
			break


n = input()
g = n.lower()
for i in range(len(g)):
	if g[-1 - i].isalpha():
		c = g[-1 - i]
		break
z = ['a', 'e', 'i', 'i', 'o', 'u', 'y']
if c in z:
	print('YES')
else:
	print('NO')


sent = input()
v = 'aeiouy'
if sent.split('?')[0].strip()[-1].lower() in v:
	print('YES')
else:
	print('NO')


import random
vowels = ['A', 'E', 'I', 'O', 'U', 'Y']
x = input()
for i in range(len(x) - 1, -1, -1):
	if x[i].isalpha():
		if x[i].upper() in vowels:
			print('YES')
			break
		else:
			print('NO')
			break


s = input()
s = s.replace(' ', '')
l = ['a', 'e', 'i', 'o', 'u', 'y']
m = ['A', 'E', 'I', 'O', 'U', 'Y']
a = s[-2]
if a in l or a in m:
	print('YES')
else:
	print('NO')


import re
while True:
	try:
		line = input().strip().lower()
	except EOFError:
		break
	chars = re.findall('[a-z]', line)
	if chars[-1] in 'aeiouy':
		print('YES')
	else:
		print('NO')


word = input().replace(' ', '')
vowel = set('aeiouyAEIOUY')
if word[-2] in vowel:
	print('YES')
else:
	print('NO')


a = input().strip()
for i in a[::-1]:
	if i.isalpha():
		if i in 'AEIOUYaeiouy':
			print('YES')
		else:
			print('NO')
		break


s = input().lower()
j = s[::-1]
for i in j:
	if i in 'bcdfghjklmnpqrstvwxz':
		print('NO')
		break
	elif i in 'aeoiuy':
		print('YES')
		break


n = input().split(' ')
x = ''
a = 'AEIOUYaeiouy'
for i in n:
	x += i
if x[-2] in a:
	print('YES')
else:
	print('NO')


q = input()
l = q.replace(' ', '')[-2:-1]
print('YES' if l.upper() in ['A', 'E', 'I', 'O', 'U', 'Y'] else 'NO')


s = input()
s = s.replace('?', '')
s = s.replace(' ', '')
if s[-1].upper() in 'AEIOUY':
	print('YES')
else:
	print('NO')


from sys import exit
listofvowels = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
listofletters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
sentence = input()
words = sentence.split()

def split(word):
	return [char for char in word]
words.reverse()
list = []
for i in range(len(words)):
	list.append(split(words[i]))
for i in range(len(words)):
	list[i].reverse()
for i in range(len(list)):
	for j in range(len(list[i])):
		if list[i][j] in listofletters and list[i][j] in listofvowels:
			print('YES')
			exit(0)
		elif list[i][j] in listofletters and (not list[i][j] in listofvowels):
			print('NO')
			exit(0)
		else:
			continue


n = input().lower()
while n[-1] not in list('abcdefghijklmnopqrstuvwxyz'):
	n = n[:-1]
n = n[-1]
if n in ['a', 'e', 'i', 'o', 'u', 'y']:
	print('YES')
else:
	print('NO')


a = input()
a = a.lower()
z = len(a) - 1
while ord(a[z]) > ord('z') or ord(a[z]) < ord('a'):
	z -= 1
if a[z] == 'a' or a[z] == 'e' or a[z] == 'i' or (a[z] == 'o') or (a[z] == 'u') or (a[z] == 'y'):
	print('YES')
else:
	print('NO')


question = str(input())
vowels = set('AEIOUYaeiouy')
q = question.index('?')
q = q - 1
while question[q] == ' ':
	q -= 1
if question[q] in vowels:
	print('YES')
else:
	print('NO')


question = input()
vowels = ['A', 'E', 'I', 'O', 'U', 'Y']
for i in range(2, len(question) + 1):
	if question[-i] != ' ':
		q_last = question[-i]
		break
for alphab in vowels:
	if q_last.upper() == alphab:
		print('YES')
		exit()
print('NO')


p = input().lower()
p = list(p)[::-1]
for i in range(len(p)):
	if p[i] >= 'a' and p[i] <= 'z':
		if p[i] == 'a' or p[i] == 'e' or p[i] == 'i' or (p[i] == 'o') or (p[i] == 'u') or (p[i] == 'y'):
			print('YES')
		else:
			print('NO')
		break


string = input()
AEI = 'aeiouy'
BCD = 'bcdfghjklmnpqrstvwxz'
i = len(string) - 1
while string[i].lower() not in AEI and string[i].lower() not in BCD:
	i -= 1
if string[i].lower() in AEI:
	print('YES')
else:
	print('NO')


import string
(s, vowel) = (input(), 'aeiouy')
s = s[::-1]
s = s.lower()
for char in s:
	if char in string.ascii_lowercase:
		if char in vowel:
			print('YES')
		else:
			print('NO')
		exit()


def sleuth(s):
	vowels = set()
	s = s.replace(' ', '')
	lst = ['a', 'e', 'i', 'o', 'u', 'y']
	for vowel in lst:
		vowels.add(vowel)
	if s[-2].lower() in vowels:
		print('YES')
	else:
		print('NO')
string = input()
sleuth(string)


listCon = []
listBigCon = []
bigCon = ['BCDFGHJKLMNPQRSTVWXZ']
con = 'bcdfghjklmnpqrstvwxz'
for i in con:
	listCon.append(i)
for j in bigCon:
	listBigCon.append(j)
bigVow = ['A', 'E', 'I', 'O', 'U', 'Y']
vow = ['a', 'e', 'i', 'o', 'u', 'y']
s = input('')

def breakS(s):
	if s[-1] == '?' or s[-1] == ' ':
		return breakS(s[:-1])
	elif s[-1] in bigVow or s[-1] in vow:
		return True
	else:
		return False
if breakS(s):
	print('YES')
else:
	print('NO')


a = input()
c = a.lower()
b = list(c)
b.reverse()
for j in range(len(b)):
	if b[int(j)].isalpha():
		if b[j] == 'a':
			print('YES')
		elif b[j] == 'e':
			print('YES')
		elif b[j] == 'i':
			print('YES')
		elif b[j] == 'o':
			print('YES')
		elif b[j] == 'u':
			print('YES')
		elif b[j] == 'y':
			print('YES')
		else:
			print('NO')
		break


s = {'A', 'E', 'I', 'O', 'U', 'Y'}
string = list(map(str, input().split()))
if string[-1] == '?':
	if string[-2][-1].upper() in s:
		print('YES')
	else:
		print('NO')
elif string[-1][-2].upper() in s:
	print('YES')
else:
	print('NO')


z = input().lower()
p = []
for i in z:
	if i == ' ' or i == '  ' or i == '   ' or (i == '?'):
		continue
	p.append(i)
if p[-1] != 'o' and p[-1] != 'a' and (p[-1] != 'i') and (p[-1] != 'e') and (p[-1] != 'y') and (p[-1] != 'u'):
	print('NO')
else:
	print('YES')


s = input().replace(' ', '').replace('?', '')
s = s.lower()
print(['NO', 'YES'][s[-1] in 'aeiouyAEIOUY'])


print(['NO', 'YES'][input().replace('?', '').split()[-1][-1].lower() in 'aeiouy'])


n = input()
a = []
for i in range(len(n)):
	if n[i] != ' ' and n[i] != '?':
		a.append(n[i])
if (a[len(a) - 1] == 'o' or a[len(a) - 1] == 'O') or (a[len(a) - 1] == 'a' or a[len(a) - 1] == 'A') or (a[len(a) - 1] == 'i' or a[len(a) - 1] == 'I') or (a[len(a) - 1] == 'u' or a[len(a) - 1] == 'U') or (a[len(a) - 1] == 'e' or a[len(a) - 1] == 'E') or (a[len(a) - 1] == 'Y' or a[len(a) - 1] == 'y'):
	print('YES')
else:
	print('NO')


import re
s = input().lower()
s = re.sub('[^a-z]', '', s)
if s[-1] in 'AEIOUY'.lower():
	print('YES')
else:
	print('NO')


a = ['A', 'E', 'I', 'O', 'U', 'Y']
b = ['B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Z']
c = list(input())
for i in reversed(range(len(c))):
	if c[i].upper() in a:
		print('YES')
		break
	if c[i].upper() in b:
		print('NO')
		break


s = input()
for i in range(len(s) - 1, -1, -1):
	if s[i] != '?' and s[i] != ' ':
		if s[i].lower() == 'a' or s[i].lower() == 'e' or s[i].lower() == 'i' or (s[i].lower() == 'o') or (s[i].lower() == 'u') or (s[i].lower() == 'y'):
			print('YES')
			break
		else:
			print('NO')
			break


sentence = input().strip('?').strip()
vowel = ['A', 'a', 'E', 'e', 'I', 'i', 'O', 'o', 'U', 'u', 'Y', 'y']
if sentence[-1] in vowel:
	print('YES')
else:
	print('NO')


s = [n for n in input()]
for n in range(len(s)):
	if ord('z') >= ord(s[n]) >= ord('a'):
		s[n] = chr(ord(s[n]) - 32)
k = []
for n in s:
	if ord('Z') >= ord(n) >= ord('A'):
		k.append(n)
v = ['A', 'E', 'I', 'O', 'U', 'Y']
if k[len(k) - 1] in v:
	print('YES')
else:
	print('NO')


import sys
input = sys.stdin.readline

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

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

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

def invr():
	return map(int, input().split())
inlt = inlt()
if inlt[-1] == '?':
	inlt[-2] = inlt[-2] + inlt[-1]
	inlt.remove('?')
vowels = ['A', 'E', 'I', 'O', 'U', 'Y']
result = 'NO'

def result():
	for v in vowels:
		if inlt[-1][-2].upper() == v:
			return 'YES'
	return 'NO'
print(result())


s = list(input())
vowels = set(['a', 'e', 'i', 'o', 'u', 'y'])
for i in reversed(range(len(s))):
	if s[i].isalpha():
		if s[i].lower() in vowels:
			print('YES')
		else:
			print('NO')
		break


print('YES' if input()[:-1].replace(' ', '').upper()[-1] in ['A', 'E', 'I', 'O', 'U', 'Y'] else 'NO')


s1 = list(input())
s2 = []
for c in s1:
	if c != ' ':
		s2.append(c)
l1 = ['a', 'A', 'e', 'E', 'i', 'I', 'o', 'O', 'u', 'U', 'y', 'Y']
if s2[-2] in l1:
	print('YES')
else:
	print('NO')


line = input()
vowels = 'aeiouyAEIOUY'
letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
for c in line[::-1]:
	if c in letters:
		print('YES' if c in vowels else 'NO')
		break


s = input()
cel = ''
alp = 'abcdefghijkmnlopqrstuwxyzABCDEFGHIJKMNLOPQRSTUWXYZ'
for i in range(len(s) - 1, -1, -1):
	if s[i] in alp:
		cel += s[i]
		break
if cel == '':
	print('NO')
elif cel in 'aeiouyAEIOUY':
	print('YES')
else:
	print('NO')


import math
from collections import *
import sys
from functools import reduce

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

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
DIRECTIONS = [[0, 1], [0, -1], [1, 0], [1, -1]]
NEIGHBOURS = [(i, j) for i in range(-1, 2) for j in range(-1, 2) if i != 0 or j != 0]
OrdUnicode_a = ord('a')
OrdUnicode_A = ord('A')
CAPS_ALPHABETS = {chr(i + OrdUnicode_A): i for i in range(26)}
SMOL_ALPHABETS = {chr(i + OrdUnicode_a): i for i in range(26)}
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0) + 1
INFINITY = float('inf')
s = input()
for i in s[::-1]:
	if i != '?' and i != ' ':
		if i.lower() in 'aeiouy':
			print('YES')
		else:
			print('NO')
		break


a = input()
V = 'AEIOUYaeiouy'
ans = ''
s = 0
for j in range(len(a) - 2, -1, -1):
	if a[j] != ' ':
		ans = a[j]
		break
for i in range(len(V)):
	if ans == V[i]:
		s = 1
if s == 1:
	print('YES')
else:
	print('NO')


print(['NO', 'YES'][len(set(list(input().lower().strip('? '))[-1]) & set('aeiouy'))])


s = input().strip('?').strip()
s = s.upper()
if s[len(s) - 1] == 'A' or s[len(s) - 1] == 'E' or s[len(s) - 1] == 'I' or (s[len(s) - 1] == 'O') or (s[len(s) - 1] == 'U') or (s[len(s) - 1] == 'Y'):
	print('YES')
else:
	print('NO')


from time import *

def sleuth(f):
	if f[len(f) - 2] in 'aieEouAIOUyY' and f[len(f) - 1] == '?':
		return 'YES'
	else:
		return ' NO'
k = input('')
count = 0
j = ''
abdo = ''
n = ''
for i in k:
	if count <= 100:
		if i in 'ABCDEFGHIJKLMNOPQURSTVWXYZabcdefghijkulmnopqrstvwxyz':
			j = abdo + i
			n = j
			count += 1
		elif i == '?':
			n = j + i
			break
print(sleuth(n))


print('YES' if input().rstrip(' ?')[-1][-1].upper() in 'AEIOUY' else 'NO')


s = input().replace(' ', '')
(vowels, ln) = ('aAeEiIoOuUyY', len(s))
print('YES' if s[ln - 2] in vowels else 'NO')


alpv = 'AEIOUY'
alpc = 'BCDFGHJKLMNPQRSTVWXZ'
s = input()
s = list(s.upper())
flag = 0
for i in range(len(s) - 1, -1, -1):
	if s[i] in alpc:
		print('NO')
		flag = 1
		break
	elif s[i] in alpv:
		print('YES')
		flag = 1
		break


YES = {'a', 'e', 'y', 'u', 'i', 'o'}
str = input()
str = str.replace('?', '')
str = str.lower()
str = str.replace(' ', '')
if str[len(str) - 1] in YES:
	print('YES')
else:
	print('NO')


question = input()
question = question.replace(' ', '')
last = question[-2].upper()
if last == 'A' or last == 'I' or last == 'E' or (last == 'O') or (last == 'U') or (last == 'Y'):
	print('YES')
else:
	print('NO')


n = list(input())
sadonok = ['A', 'E', 'I', 'O', 'U', 'Y']
x = []
for i in range(len(n)):
	n[i] = n[i].upper()
for i in range(len(n)):
	if n[i] != ' ':
		x.append(n[i])
if x[-2] in sadonok:
	print('YES')
else:
	print('NO')


s = list(map(str, input().split()))
S = ['A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y']
S = set(S)
if s[-1] == '?':
	if s[-2][-1] in S:
		print('YES')
	else:
		print('NO')
elif s[-1][-2] in S:
	print('YES')
else:
	print('NO')


C = input().split()
if len(C[-1]) > 1:
	C = C[-1][-2]
else:
	C = C[-2][-1]
if C.lower() == 'a' or C.lower() == 'e' or C.lower() == 'i' or (C.lower() == 'u') or (C.lower() == 'o') or (C.lower() == 'y'):
	print('YES')
else:
	print('NO')


s = input().lower()
for ch in s:
	if ch >= 'a' and ch <= 'z':
		ans = ch == 'a' or ch == 'e' or ch == 'i' or (ch == 'o') or (ch == 'u') or (ch == 'y')
if ans:
	print('YES')
else:
	print('NO')


n = input().lower().split('?')
a = list(n[0].strip())[-1]
if a == 'a' or a == 'e' or a == 'o' or (a == 'i') or (a == 'u') or (a == 'y'):
	print('YES')
else:
	print('NO')


s = input()
s = s.lower()
x = ['a', 'e', 'i', 'o', 'u', 'y']
for i in s[::-1]:
	p = ord(i)
	if p > 96 and p < 123:
		if i in x:
			print('YES')
		else:
			print('NO')
		break


import string
l = input()
l = l.translate(str.maketrans(' ', ' ', string.punctuation))
l = l.replace(' ', '')
l.split()
l.lower()
f = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
if l[-1] not in f:
	print('NO')
else:
	print('YES')


a = input()[:-1].split()[-1]
print('NYOE S'[a[-1] in 'aeiouyAEIOUY'::2])


x = input()
x = x.replace(' ', '')
vowel = ['a', 'e', 'i', 'o', 'u', 'y']
y = len(x)
f = x[y - 2].lower()
if f in vowel:
	print('YES')
else:
	print('NO')


def main():
	s = [i for i in input() if i not in ' ?']
	if s[-1] in 'aeiouyAEIOUY':
		print('YES')
	else:
		print('NO')
main()


a = input()
b = -1
gl = ['A', 'E', 'I', 'O', 'U', 'Y']
while not a[b].isalpha():
	b -= 1
if a[b].upper() in gl:
	print('YES')
else:
	print('NO')


s = input()
i = -1
while s[i] == ' ' or s[i] == '?':
	i -= 1
if s[i] == 'a' or s[i] == 'e' or s[i] == 'i' or (s[i] == 'o') or (s[i] == 'u') or (s[i] == 'y') or (s[i] == 'A') or (s[i] == 'E') or (s[i] == 'I') or (s[i] == 'O') or (s[i] == 'U') or (s[i] == 'Y'):
	print('YES')
else:
	print('NO')


s = input()
i = -1
while not (s[i] >= 'a' and s[i] <= 'z' or (s[i] >= 'A' and s[i] <= 'Z')):
	i -= 1
if s[i] == 'A' or s[i] == 'E' or s[i] == 'I' or (s[i] == 'O') or (s[i] == 'U') or (s[i] == 'Y') or (s[i] == 'a') or (s[i] == 'e') or (s[i] == 'i') or (s[i] == 'o') or (s[i] == 'u') or (s[i] == 'y'):
	print('YES')
else:
	print('NO')


s = input()
for i in range(len(s) - 1, -1, -1):
	if ord(s[i]) >= 65 and ord(s[i]) <= 90 or (ord(s[i]) >= 97 and ord(s[i]) <= 122):
		if s[i] == 'A':
			print('YES')
		elif s[i] == 'E':
			print('YES')
		elif s[i] == 'I':
			print('YES')
		elif s[i] == 'O':
			print('YES')
		elif s[i] == 'U':
			print('YES')
		elif s[i] == 'Y':
			print('YES')
		elif s[i] == 'a':
			print('YES')
		elif s[i] == 'e':
			print('YES')
		elif s[i] == 'i':
			print('YES')
		elif s[i] == 'o':
			print('YES')
		elif s[i] == 'u':
			print('YES')
		elif s[i] == 'y':
			print('YES')
		else:
			print('NO')
		break


s = input().replace(' ', '')
print('YNEOS'[not s[-2].lower() in 'aeiouy'::2])


n = input()
p = n[::-1]
s = 0
a = 'aeiouyAEIOUY'
for i in p:
	if i == ' ':
		pass
	elif i == '?':
		pass
	elif 65 <= ord(i) <= 90 or 97 <= ord(i) <= 122:
		s += 1
		if i in a:
			print('YES')
		else:
			print('NO')
	if s == 1:
		break


s = input()
s = s.replace(' ', '')
s = s.lower()
v = ['a', 'e', 'i', 'o', 'u', 'y']
if s[-2] in v:
	print('YES')
else:
	print('NO')


st = list(map(str, input().split()))
if len(st) > 1:
	if st[len(st) - 1] != '?':
		if st[len(st) - 1][-2] == 'a' or st[len(st) - 1][-2] == 'e' or st[len(st) - 1][-2] == 'i' or (st[len(st) - 1][-2] == 'o') or (st[len(st) - 1][-2] == 'u') or (st[len(st) - 1][-2] == 'y') or (st[len(st) - 1][-2] == 'A') or (st[len(st) - 1][-2] == 'E') or (st[len(st) - 1][-2] == 'O') or (st[len(st) - 1][-2] == 'I') or (st[len(st) - 1][-2] == 'U') or (st[len(st) - 1][-2] == 'Y'):
			print('YES')
		else:
			print('NO')
	elif st[len(st) - 2][-1] == 'a' or st[len(st) - 2][-1] == 'e' or st[len(st) - 2][-1] == 'i' or (st[len(st) - 2][-1] == 'o') or (st[len(st) - 2][-1] == 'u') or (st[len(st) - 2][-1] == 'y') or (st[len(st) - 2][-1] == 'A') or (st[len(st) - 2][-1] == 'E') or (st[len(st) - 2][-1] == 'O') or (st[len(st) - 2][-1] == 'I') or (st[len(st) - 2][-1] == 'U') or (st[len(st) - 2][-1] == 'Y'):
		print('YES')
	else:
		print('NO')
elif len(st[0]) > 1:
	if st[0][-2] == 'a' or st[0][-2] == 'e' or st[0][-2] == 'o' or (st[0][-2] == 'i') or (st[0][-2] == 'u') or (st[0][-2] == 'y') or (st[0][-2] == 'A') or (st[0][-2] == 'O') or (st[0][-2] == 'E') or (st[0][-2] == 'I') or (st[0][-2] == 'U') or (st[0][-2] == 'Y'):
		print('YES')
	else:
		print('NO')


a = input()
vocali = {'A', 'a', 'E', 'e', 'I', 'i', 'O', 'o', 'U', 'u', 'Y', 'y'}
for x in range(1, len(a) + 1):
	if a[-x] >= 'A' and a[-x] <= 'z':
		if a[-x] in vocali:
			print('YES')
			break
		else:
			print('NO')
			break


s = input()
s = s.lower()
i = s.find('?')
s1 = s[::-1]
a = 1
while s1[a] == ' ':
	i = i - 1
	a = a + 1
if s[i - 1] == 'a' or s[i - 1] == 'e' or s[i - 1] == 'i' or (s[i - 1] == 'o') or (s[i - 1] == 'u') or (s[i - 1] == 'y'):
	print('YES')
else:
	print('NO')


def q49a():
	vowels = [letter for letter in 'AEIOUY']
	consonants = [letter for letter in 'BCDFGHJKLMNPQRSTUVWXZ']
	input_str = input()
	input_str = input_str[::-1]
	for letter in input_str:
		if letter.upper() == '?' or letter.upper() == ' ':
			continue
		else:
			if letter.upper() in vowels:
				print('YES')
			else:
				print('NO')
			exit()
q49a()


if input().split('?')[0].split()[-1][-1] in 'AEIOUYaeiouy':
	print('YES')
else:
	print('NO')


s = input()
k = len(s)
v = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
l = []
for i in range(k):
	if s[i] != ' ':
		l.append(s[i])
l1 = len(l)
if l[l1 - 2] in v:
	print('YES')
else:
	print('NO')


s = input()
s = s.replace(' ', '')
s = s.lower()
v = ['a', 'e', 'i', 'o', 'u', 'y']
l = []
for i in v:
	if i == s[-2]:
		l.append('YES')
	else:
		l.append('NO')
l = sorted(l, reverse=True)
print(l[0])


print(['NO', 'YES'][input().replace('?', '').split()[-1][-1].lower() in 'aeyuio'])


str = input()
t = len(str) - 2
for ch in str:
	if str[t] in ' ':
		t -= 1
	elif str[t] in ('a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y'):
		print('YES')
		break
	else:
		print('NO')
		break


print('YES' if input().replace('?', ' ').replace(' ', '')[-1].lower() in 'aeiouy' else 'NO')


c = input().split('?')[0].split()[-1][-1]
if c in 'aeiouyAEIOUY':
	print('YES')
else:
	print('NO')


a = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
n = list(input())
t = []
for i in range(len(n)):
	if 64 < ord(n[i]) < 91 or 96 < ord(n[i]) < 123:
		t.append(n[i])
if t[-1] in a:
	print('YES')
else:
	print('NO')


s = input()
p = -1
for i in s:
	if i >= 'A' and i <= 'Z':
		i = i.lower()
		p = i
	elif i >= 'a' and i <= 'z':
		p = i
if p == 'a' or p == 'e' or p == 'i' or (p == 'o') or (p == 'u') or (p == 'y'):
	print('YES')
else:
	print('NO')


s = input()
v = 'aeiouy'
c = 'bcdfghjklmnpqrstvwxz'
j = -1
for i in range(-1, -len(s) - 1, -1):
	c = s[i]
	if c != '?' and c != ' ':
		j = i
		break
char = s[j].lower()
if char in v:
	print('YES')
elif char in c:
	print('NO')
else:
	print('NO')


from math import sqrt

def main():
	n = input()
	d = [c for c in n if c.isalpha()]
	if d[-1].lower() in 'aeiouy':
		print('YES')
	else:
		print('NO')
main()


def solution(l1):
	l1 = [x for x in l1 if x != '?' and x != ' ']
	vowels = 'aeiouy'
	if l1[-1].lower() in vowels:
		return 'YES'
	else:
		return 'NO'

def answer():
	l1 = list(input())
	print(solution(l1))
answer()


a = input().lower()
n = len(a)
b = a[0:n - 1]
c = b.strip()
if c[-1] == 'a' or c[-1] == 'e' or c[-1] == 'i' or (c[-1] == 'o') or (c[-1] == 'u') or (c[-1] == 'y'):
	print('YES')
else:
	print('NO')


vs = set('A, E, I, O, U, Y'.split(', '))

def ivl(s):
	for c in s[::-1]:
		if c.isalpha():
			return c in vs or c.upper() in vs
r = 'NO'
if ivl(input()):
	r = 'YES'
print(r)


n = input()
l = list(n)
while l.count(' ') != 0:
	l.remove(' ')
n = len(l)
j = l[n - 2]
if j == 'a' or j == 'e' or j == 'i' or (j == 'o') or (j == 'u') or (j == 'y') or (j == 'A') or (j == 'E') or (j == 'I') or (j == 'O') or (j == 'U') or (j == 'Y'):
	print('YES')
else:
	print('NO')


def sleuth(question_str) -> str:
	question_lc = question_str.lower()
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	vowel = 'aeiouy'
	for i in range(len(question_lc) - 1, -1, -1):
		if question_lc[i] in alphabet:
			if question_lc[i] in vowel:
				return 'YES'
			else:
				return 'NO'
question = input()
print(sleuth(question))


s = input()
s = s[:-1].strip()
glas = ['A', 'E', 'I', 'O', 'U', 'Y']
if s[-1].upper() in glas:
	print('YES')
else:
	print('NO')


s = input()
s = ''.join(s.split())
d1 = 'AEIOUY'
d2 = 'BCDFGHJKLMNPQRSTVWXZ'
if s[-2].upper() in d1:
	print('YES')
else:
	print('NO')


a = [i for i in input().strip('?').split()]
c = ['a', 'e', 'i', 'o', 'u', 'y']
if a[-1][-1].lower() in c:
	print('YES')
else:
	print('NO')


s = input()
flag = 0
for i in range(0, len(s)):
	if s[i] == 'a' or s[i] == 'e' or s[i] == 'i' or (s[i] == 'o') or (s[i] == 'u') or (s[i] == 'y'):
		flag = 1
	elif s[i] == 'A' or s[i] == 'E' or s[i] == 'I' or (s[i] == 'O') or (s[i] == 'U') or (s[i] == 'Y'):
		flag = 1
	elif s[i] >= 'a' and s[i] <= 'z' or (s[i] >= 'A' and s[i] <= 'Z'):
		flag = 0
if flag:
	print('YES')
else:
	print('NO')


a = input()
c = a.lower().strip(' ?')
b = c[::-1]
if b[0] in 'aeiouy':
	print('YES')
else:
	print('NO')


s = input()
vowel = 'aeiouy'
b = list(s.lower().replace(' ', ''))
n = len(b)
if b[n - 2] in vowel:
	print('YES')
else:
	print('NO')


import re
test_case = str(input()).lower()
a = ['a', 'e', 'i', 'o', 'u', 'y']
clean_test_case = re.sub('[^a-z]', '', test_case)
print('YES' if clean_test_case[-1] in a else 'NO')


question = input()[::-1]
for letter in question:
	if letter == '?' or letter == ' ':
		continue
	elif letter == 'a' or letter == 'A' or letter == 'e' or (letter == 'E') or (letter == 'i') or (letter == 'I') or (letter == 'o') or (letter == 'O') or (letter == 'u') or (letter == 'U') or (letter == 'y') or (letter == 'Y'):
		print('YES')
		break
	else:
		print('NO')
		break


i = ''.join(input().split())[-2].upper()
v = ['A', 'E', 'I', 'O', 'U', 'Y']
if i in v:
	print('YES')
else:
	print('NO')


def readln():
	return tuple(map(int, input().split()))
print('YES' if input().strip()[:-1].strip()[-1].lower() in list('aeiouy') else 'NO')


from string import ascii_lowercase, ascii_uppercase
ascii = ascii_lowercase + ascii_uppercase
s = input()
ans = None
for c in s:
	if c not in ascii:
		continue
	if c in 'AEIOUYaeiouy':
		ans = 'YES'
	else:
		ans = 'NO'
print(ans)


__author__ = 'runekri3'
VOWELS = list('aeiouy')
CONSONANTS = list('bcdefghjklmnpqrstvwxyz')
question = input()
for letter in reversed(question.lower()):
	if letter in VOWELS:
		print('YES')
		break
	elif letter in CONSONANTS:
		print('NO')
		break


list1 = ['A', 'E', 'I', 'O', 'U', 'Y']
list2 = ['A', 'E', 'I', 'O', 'U', 'Y', 'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Z']
k = input()
k = k.upper()
k = k[::-1]
str = ''
for i in k:
	if i in list2:
		str += i
if str[0] in list1:
	print('YES')
else:
	print('NO')


print('YES' if ''.join(list(input().lower().split()))[-2] in 'aeiouy' else 'NO')


string = input().lower()
n = len(string)
flag = False
for i in range(n):
	temp = string[i]
	if temp >= 'a' and temp <= 'z':
		if temp == 'a' or temp == 'e' or temp == 'i' or (temp == 'o') or (temp == 'u') or (temp == 'y'):
			flag = True
		else:
			flag = False
if flag:
	print('YES')
else:
	print('NO')


s = input()
s = s.replace(' ', '', len(s))
s = s.replace('?', '', len(s))
for i in s[::-1]:
	if i.lower() in 'aeiouy':
		print('YES')
	else:
		print('NO')
	break


l = list(input())
for i in l:
	if i == ' ':
		l.remove(i)
	for j in l:
		if j == ' ':
			l.remove(j)
	for h in l:
		if h == ' ':
			l.remove(h)
ch = l[-2]
if ch == 'A' or ch == 'a' or ch == 'E' or (ch == 'e') or (ch == 'I') or (ch == 'i') or (ch == 'O') or (ch == 'o') or (ch == 'U') or (ch == 'u') or (ch == 'Y') or (ch == 'y'):
	print('YES')
else:
	print('NO')


s = input()
ans = 1
for i in range(len(s)):
	if s[i].isalpha():
		if s[i].upper() == 'A' or s[i].upper() == 'E' or s[i].upper() == 'I' or (s[i].upper() == 'O') or (s[i].upper() == 'U') or (s[i].upper() == 'Y'):
			ans = 0
			continue
		ans = 1
if ans == 0:
	print('YES')
else:
	print('NO')


s = input()
l = s[::-1]
q = 'auioeyAUIOYE'
for i in range(len(s)):
	if l[i].isalpha():
		if l[i] in q:
			print('YES')
			break
		else:
			print('NO')
			break


n = input().strip()
ans = [97, 101, 105, 111, 117, 121, 65, 69, 73, 79, 85, 89]
f = 0
for i in range(len(n) - 1, -1, -1):
	if 65 <= ord(n[i]) <= 90 or 97 <= ord(n[i]) <= 122:
		if ord(n[i]) in ans:
			print('YES')
			break
		else:
			print('NO')
			break


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

def main():
	s = input().lower()[::-1]
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	vowel = ['a', 'e', 'i', 'o', 'u', 'y']
	for i in s:
		if i in alpha:
			if i in vowel:
				print('YES')
			else:
				print('NO')
			return
		else:
			continue
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')
main()


s = input()
s = s.lower()
s = ''.join(s.split())
if s[len(s) - 2] in ['a', 'e', 'i', 'o', 'u', 'y']:
	print('YES')
else:
	print('NO')


vowel = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
s = input().replace(' ', '')
char = s[-2]
if char in vowel:
	print('YES')
else:
	print('NO')


s = input()
d = 0
e = 0
f = 0
n = len(s)
for i in range(0, len(s)):
	if s[n - i - 1] >= 'a' and s[n - i - 1] <= 'z' or (s[n - i - 1] >= 'A' and s[n - i - 1] <= 'Z'):
		q = s[n - i - 1]
		if q == 'a' or q == 'e' or q == 'i' or (q == 'u') or (q == 'o') or (q == 'y') or (q == 'A') or (q == 'E') or (q == 'I') or (q == 'U') or (q == 'O') or (q == 'Y'):
			print('YES')
			exit(0)
		else:
			print('NO')
			exit(0)


n = input().lower()
x = [97, 101, 105, 111, 117, 121]
i = len(n) - 1
while i + 1:
	on = ord(n[i])
	if on in range(97, 123):
		if on in x:
			print('YES')
		else:
			print('NO')
		break
	i -= 1


l = input().split()
b = ['A', 'E', 'I', 'O', 'U', 'Y']
if len(l[-1]) != 1:
	if l[-1][-2].upper() in b:
		print('YES')
	else:
		print('NO')
elif l[-2][-1].upper() in b:
	print('YES')
else:
	print('NO')


def main():
	vow = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
	s = input()
	n = len(s)
	for i in range(n - 2, -1, -1):
		if s[i] == ' ':
			continue
		elif s[i] in vow:
			print('YES')
			return
		else:
			print('NO')
			return
main()


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

def sleuth(s):
	lastLetter = ''
	for char in s:
		if char == '?':
			return lastLetter
		if char != ' ':
			lastLetter = char.lower()
	return lastLetter
s = input()
print('YES' if sleuth(s) in vowels else 'NO')


s = input()
l = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
if s[-2] in l:
	print('YES')
elif s[-2] == ' ':
	i = -2
	while s[i] == ' ':
		i = i - 1
	if s[i] in l:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


a = str(input())
a = a.replace('?', '')
a = a.replace(' ', '')
last_letter = str(a[-1])
vowel = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U', 'Y', 'y']
if last_letter in vowel:
	print('YES')
else:
	print('NO')


s = list(map(str, input()))
for i in range(len(s)):
	if s[-2] == ' ':
		s.remove(s[-2])
k = s[-2]
if k == 'A' or k == 'E' or k == 'I' or (k == 'O') or (k == 'U') or (k == 'Y') or (k == 'a') or (k == 'e') or (k == 'i') or (k == 'o') or (k == 'u') or (k == 'y'):
	print('YES')
else:
	print('NO')


vovel = ['a', 'e', 'i', 'o', 'u', 'y']
conso = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'z']
s = input().replace(' ', '')
if s[-2].lower() in vovel:
	print('YES')
else:
	print('NO')


s = list(input().rstrip('?').split(' '))
s.reverse()
for i in s:
	if i != '':
		if i[-1].lower() == 'a' or i[-1].lower() == 'e' or i[-1].lower() == 'i' or (i[-1].lower() == 'o') or (i[-1].lower() == 'u') or (i[-1].lower() == 'y'):
			print('YES')
		else:
			print('NO')
		break


a = str(input())
r = ''
b = 'AEIOUYaeiou'
c = 'BCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz'
for i in a:
	if i in b or i in c:
		r += i
if r[-1] in b:
	print('YES')
else:
	print('NO')


s = str(input())
q = s.strip()
t = q.replace('    ', '')
e = t.replace('   ', '')
r = e.replace('  ', '')
p = r.replace(' ', '')
n = len(p)
if p[n - 2] == 'A':
	print('YES')
elif p[n - 2] == 'E':
	print('YES')
elif p[n - 2] == 'I':
	print('YES')
elif p[n - 2] == 'O':
	print('YES')
elif p[n - 2] == 'U':
	print('YES')
elif p[n - 2] == 'Y':
	print('YES')
elif p[n - 2] == 'a':
	print('YES')
elif p[n - 2] == 'e':
	print('YES')
elif p[n - 2] == 'i':
	print('YES')
elif p[n - 2] == 'o':
	print('YES')
elif p[n - 2] == 'u':
	print('YES')
elif p[n - 2] == 'y':
	print('YES')
else:
	print('NO')


str_ = str(input())
lower_ = str_.lower()
whitespace = lower_.replace(' ', '')
vowel = ['a', 'e', 'i', 'o', 'u', 'y']
if whitespace[-2] in vowel:
	print('YES')
else:
	print('NO')


pregunta = str(input())
pregunta = pregunta.lower()
i = len(pregunta) - 1
while pregunta[i] == ' ' or pregunta[i] == '?':
	i = i - 1
if pregunta[i] == 'a' or pregunta[i] == 'e' or pregunta[i] == 'i' or (pregunta[i] == 'o') or (pregunta[i] == 'u') or (pregunta[i] == 'y'):
	print('YES')
else:
	print('NO')


inp = input()[:-1].lower().split()
if inp[-1][-1] in ('a', 'e', 'i', 'o', 'u', 'y'):
	print('YES')
else:
	print('NO')


question = input()
last_letter = question[:-1].strip().upper()[-1]
if last_letter in ['A', 'E', 'I', 'O', 'U', 'Y']:
	print('YES')
else:
	print('NO')


str = input()
arr = str.split()
y = arr[-1]
if y[0] == '?':
	y = arr[-2]
	ch = y[-1]
else:
	ch = y[-2]
if ch == 'A' or ch == 'a' or ch == 'E' or (ch == 'e') or (ch == 'I') or (ch == 'i') or (ch == 'O') or (ch == 'o') or (ch == 'U') or (ch == 'u') or (ch == 'Y') or (ch == 'y'):
	print('YES')
else:
	print('NO')


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
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))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def solve():
	vowel = ['a', 'e', 'i', 'o', 'u', 'y']
	s = inp().lower()
	for i in range(len(s) - 1, -1, -1):
		if s[i].isalpha():
			if s[i] in vowel:
				print('YES')
			else:
				print('NO')
			exit()
	print('NO')
solve()


n = input()
n = n.replace('?', ' ')
n = n.lower()
n = n.rstrip(' ')
n = list(n)
if n[len(n) - 1] == 'a' or n[len(n) - 1] == 'e' or n[len(n) - 1] == 'i' or (n[len(n) - 1] == 'o') or (n[len(n) - 1] == 'u') or (n[len(n) - 1] == 'y'):
	print('YES')
else:
	print('NO')


sentence = input().split()

def main(sentence):
	vowels = ['A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y']
	if sentence[-1] == '?':
		if sentence[-2][-1] in vowels:
			return 'YES'
		else:
			return 'NO'
	elif sentence[-1][-2] in vowels:
		return 'YES'
	else:
		return 'NO'
print(main(sentence))


s = input()
i = len(s) - 1
while s[i] not in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ':
	i = i - 1
if s[i] in 'aeiouyAEIOUY':
	print('YES')
else:
	print('NO')


s = str(input())
s = s[::-1]
for i in s:
	if i != ' ' and i != '?':
		c = i.lower()
		break
if c == 'a' or c == 'e' or c == 'i' or (c == 'o') or (c == 'u') or (c == 'y'):
	print('YES')
else:
	print('NO')


vowels = 'aeiouy'
alpha = 'abcdefghijklmnopqrstuvwxyz'
lower = input()
line = ''
question = lower.lower()
for i in question:
	if i in alpha:
		line += i
if line[-1] in vowels:
	print('YES')
else:
	print('NO')


question = input().strip()
vowels = 'AaEeIiOoUuYy'
lastchar = None
i = len(question) - 1
while i >= 0:
	if question[i] != '?' and question[i] != ' ':
		lastchar = question[i]
		break
	i -= 1
if lastchar in vowels:
	print('YES')
else:
	print('NO')


n = input()
c = 0
n = n.upper()
s = 'AEIOUY'
n = n.replace(' ', '')
if n[-2] in s:
	print('YES')
else:
	print('NO')


last = ''.join(input().split())
vowels = ['a', 'e', 'i', 'o', 'u', 'y']
if last[-2].lower() in vowels:
	print('YES')
else:
	print('NO')


s = input()
s = s.replace(' ', '')
vowels = 'aeouiyAEOUIY'
if s[-2] in vowels:
	print('YES')
else:
	print('NO')


import re
s = str(input())
consonants = 'BCDFGHJKLMNPQRSTVWXZ'
last_letter = list(re.finditer('[a-zA-Z]', s, re.I))[-1]
if last_letter.group().upper() not in consonants:
	print('YES')
else:
	print('NO')


import math

def positions(str):
	for i in str:
		return ord(i) & NUM

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

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

def li():
	return list(mi())
a = input()
n = len(a)
j = 0
v = ['a', 'A', 'e', 'E', 'i', 'I', 'o', 'O', 'u', 'U', 'y', 'Y']
for i in range(n):
	if a[n - i - 1] != '?' and a[n - i - 1] != ' ':
		j = n - i - 1
		break
if a[j] in v:
	print('YES')
else:
	print('NO')


line = input().upper()
vowels = ['A', 'E', 'I', 'O', 'U', 'Y']
for i in range(len(line) - 1, -1, -1):
	if line[i] != '?' and line[i] != ' ':
		if line[i] in vowels:
			print('YES')
		else:
			print('NO')
		break


vowels = 'aoiueyAOIUEY'
s = list(str(input()))
i = s.pop()
while i == ' ' or i == '?':
	i = s.pop()
if i in vowels:
	print('YES')
else:
	print('NO')


s = input()
i = len(s) - 1
v = 'aeiouyAEIOUY'
while s[i] == '?' or s[i] == ' ':
	i -= 1
if s[i] in v:
	print('YES')
else:
	print('NO')


s = input()
i = len(s)
i = i - 1
while i:
	i = i - 1
	if s[i] == ' ':
		continue
	elif s[i] == 'a' or s[i] == 'e' or s[i] == 'i' or (s[i] == 'o') or (s[i] == 'u') or (s[i] == 'y'):
		print('YES')
		break
	elif s[i] == 'A' or s[i] == 'E' or s[i] == 'I' or (s[i] == 'O') or (s[i] == 'U') or (s[i] == 'Y'):
		print('YES')
		break
	else:
		print('NO')
		break


q = input()
q = q[::-1]
arr = ['A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y']
for j in q:
	if j.isalpha():
		try:
			p = arr.index(j)
			print('YES')
		except:
			print('NO')
		break


s = input('')
s1 = s.lower()
i = len(s1)
vowel = ['a', 'e', 'i', 'o', 'u', 'y']
i = len(s1) - 1
while i >= 0:
	if ord(s1[i]) >= 97 and ord(s1[i]) <= 122:
		if s1[i] in vowel:
			print('YES')
		else:
			print('NO')
		break
	i -= 1


s = input().upper().split()
s = ''.join(s)
l = ['A', 'E', 'I', 'O', 'U', 'Y']
n = len(s)
if s[n - 2] in l:
	print('YES')
else:
	print('NO')


v = ['a', 'e', 'o', 'i', 'u', 'A', 'E', 'I', 'O', 'U', 'y', 'Y']
a = input()
n = len(a)
for i in range(n - 1, -1, -1):
	if not (a[i] == ' ' or a[i] == '?'):
		if a[i] in v:
			print('YES')
		else:
			print('NO')
		break
	else:
		continue


s = input()
f = 0
vowel = 'aeiouyAEIOUY'
for i in range(len(s) - 1, -1, -1):
	if s[i] in vowel:
		f = 1
		break
	if s[i].isalpha():
		break
if f == 1:
	print('YES')
else:
	print('NO')


s = input().lower()
res = False
for i in s:
	if i.isalpha():
		if i in ['a', 'e', 'i', 'o', 'u', 'y']:
			res = True
		else:
			res = False
if res:
	print('YES')
else:
	print('NO')


s = input()
a = s.translate({ord(i): None for i in '?,.! '})
x = 'AOUIEaouieYy'
c = 0
for i in x:
	if i in a[-1]:
		c += 1
if c == 1:
	print('YES')
else:
	print('NO')


lst = ['a', 'i', 'e', 'o', 'y', 'u']
s = input()
for i in range(len(s) - 1, -1, -1):
	if s[i].isalpha():
		if s[i].lower() in lst:
			print('YES')
			break
		else:
			print('NO')
			break


print(('NO', 'YES')[input().rstrip(' ?')[-1].upper() in 'AEIOUY'])


s = input()
s1 = s.split(' ')
l = ''.join(s1).upper()
a = ['A', 'E', 'I', 'O', 'U', 'Y']
if l[-2] in a:
	print('YES')
else:
	print('NO')


IL = lambda : list(map(int, input().split()))
s = input()
print('YES' if s.lower().strip(' ?')[-1] in 'aeiouy' else 'NO')


questions = input('')
vowels = 'aeiouy'
questions = questions.lower()
counter = -1
found = False
count = 0
while count != 1:
	letter = questions[counter]
	if letter.isalpha():
		count += 1
		if letter in vowels:
			found = True
	counter -= 1
if found:
	print('YES')
else:
	print('NO')


vowels = {'a', 'e', 'i', 'o', 'u', 'y'}

def last_letter(line):
	line_len = len(line)
	for j in range(1, line_len + 1):
		if line[-1 * j].isalpha():
			return line[-1 * j]
line = input().strip().lower()
if last_letter(line) in vowels:
	print('YES')
else:
	print('NO')


q = input().upper()
l = len(q)
v = ('A', 'I', 'O', 'U', 'E', 'Y')
for i in q:
	if 65 <= ord(i) <= 90 or i == ' ' or i == '?':
		for j in range(-1, -l - 1, -1):
			if 65 <= ord(q[j]) <= 90:
				if q[j] in v:
					print('YES')
					break
				else:
					print('NO')
					break
		else:
			print('NO')
			break
	else:
		print('NO')
		break
	break


ques = input()
ques = ques.upper()
b = ques[::-1]
i = 0
while b[i] == '?' or b[i] == ' ':
	i += 1
if b[i] == 'A' or b[i] == 'E' or b[i] == 'I' or (b[i] == 'O') or (b[i] == 'U') or (b[i] == 'Y'):
	print('YES')
else:
	print('NO')


a = 'AEIOUY'
a += a.lower()
print('YES' if ''.join(input().split())[-2] in a else 'NO')


s = input()
letters = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
for i in range(len(s)):
	if s[-i - 1].isalpha() and s[-i - 1] in letters:
		print('YES')
		exit()
	if s[-i - 1].isalpha() and s[-i - 1] not in letters:
		print('NO')
		exit()


s = input()

def Sleuth(s):
	for i in range(len(s) - 1, -1, -1):
		if s[i] == ' ' or s[i] == '?':
			continue
		elif s[i].lower() == 'a' or s[i].lower() == 'e' or s[i].lower() == 'i' or (s[i].lower() == 'o') or (s[i].lower() == 'u') or (s[i].lower() == 'y'):
			print('YES')
			break
		else:
			print('NO')
			break
Sleuth(s)


import sys
from array import array

def input():
	return sys.stdin.buffer.readline().decode('utf-8')
s = input().rstrip()
s = s.replace('?', '')
s = s.replace(' ', '')
print('YES' if s[-1] in 'aeiouyAEIOUY' else 'NO')


f1 = ['A', 'E', 'I', 'O', 'U', 'Y']
f2 = '?'
s = input().upper()
n = len(s) - 1
if s[-1] == f2:
	s = s.replace(s[-1], '', 1)
x = s[-1]
i = -1
while x == ' ':
	x = s[i - 1]
	i -= 1
if x in f1:
	print('YES')
else:
	print('NO')


import string
alphabet = string.ascii_lowercase
s = [x for x in list(input().lower()) if x in alphabet]
if s[-1] in ['a', 'e', 'i', 'o', 'u', 'y']:
	print('YES')
else:
	print('NO')


s = input()
s = s.replace('?', '')
s = s.strip()
if s[len(s) - 1] == 'A' or s[len(s) - 1] == 'E' or s[len(s) - 1] == 'I' or (s[len(s) - 1] == 'O') or (s[len(s) - 1] == 'U') or (s[len(s) - 1] == 'Y') or (s[len(s) - 1] == 'a') or (s[len(s) - 1] == 'e') or (s[len(s) - 1] == 'i') or (s[len(s) - 1] == 'o') or (s[len(s) - 1] == 'u') or (s[len(s) - 1] == 'y'):
	print('YES')
else:
	print('NO')


s = input()
s = s.upper()
l = ['A', 'E', 'O', 'U', 'Y', 'I']
i = len(s) - 1
while i >= 0:
	if s[i] != ' ' and s[i] != '?':
		if s[i] in l:
			print('YES')
			break
		else:
			print('NO')
			break
	i -= 1


s = input()
vowels = 'aeiouyAEIOUY'
if s.split()[-1] == '?':
	if s.split()[-2][-1] in vowels:
		print('YES')
	else:
		print('NO')
elif s.split()[-1][:-1][-1] in vowels:
	print('YES')
else:
	print('NO')


a = str(input())
b = 'aeiouy'
a = a[::-1]
for i in a:
	if i != '?' and i != ' ':
		if b.count(i.lower()) != 0:
			print('YES')
		else:
			print('NO')
		break


s = input()
s = s.split()
vowels = 'aeiouAEIOUyY'
if s[-1] == '?':
	k = s[-2][-1]
	if k in vowels:
		print('YES')
	else:
		print('NO')
else:
	k = s[-1][-2]
	if k in vowels:
		print('YES')
	else:
		print('NO')


x = input().lower().replace('?', '').replace(' ', '')
if x[-1:] == 'y' or x[-1:] == 'a' or x[-1:] == 'e' or (x[-1:] == 'i') or (x[-1:] == 'u') or (x[-1:] == 'o'):
	print('YES')
else:
	print('NO')


n = input().strip()
v = 'AEIOUY'
n = ''.join(n.split())
if n.upper()[len(n) - 2] in v:
	print('YES')
else:
	print('NO')


n = input()
a = 'aeiouy'
n = n.lower()
n = n.replace(' ', '')
n = n.replace('?', '')
if n[-1] in a:
	print('YES')
else:
	print('NO')


print(('NO', 'YES')[input().lower().strip('? ')[-1] in 'aeiouy'])


s = input().upper().strip()
vowels = ['A', 'E', 'I', 'O', 'U', 'Y']
s1 = s[-2]
f = 0
for i in s:
	if i != ' ' and i != '?':
		if i in vowels:
			f = 1
		else:
			f = 0
if f == 1:
	print('YES')
else:
	print('NO')


s = input()
vowels = 'aeiouy'
k = s.replace(' ', '').lower()
if k[len(k) - 2] in vowels:
	print('YES')
else:
	print('NO')


s = input()
u = s.replace('?', ' ')
v = u.replace(' ', '')
l = len(v)
vowel = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
if v[l - 1] in vowel:
	print('YES')
else:
	print('NO')


def vowel(c):
	s = 'AEIOUY'
	if c.upper() in s:
		return True
	return False
s = input()
n = len(s) - 1
while n >= 0:
	if s[n] not in ' ?':
		if vowel(s[n]):
			print('YES')
		else:
			print('NO')
		exit()
	n -= 1


string = input()[:-1].replace(' ', '')
vowels = ['A', 'E', 'I', 'O', 'U', 'Y']
if string[len(string) - 1].upper() in vowels:
	print('YES')
else:
	print('NO')


st = list(input())
n = len(st) - 2
l = list('aeiouyAEIOYU')
while st[n] == ' ':
	n -= 1
if st[n] in l:
	print('YES')
	exit()
print('NO')


def main():
	s = str(input())
	G = ['A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y']
	i = -1
	while s[i] == ' ' or s[i] == '?':
		i -= 1
	if s[i] in G:
		print('YES')
	else:
		print('NO')
main()


a = input()
n = len(a)
s = ''
for i in range(n):
	if a[i] == ' ' or a[i] == '?':
		continue
	else:
		s = s + a[i]
k = len(s)
ch = s[k - 1]
if ch in ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']:
	print('YES')
else:
	print('NO')


n = input()
n = n[:len(n) - 1]
v = ['A', 'E', 'I', 'O', 'U', 'Y']
n = n.upper().strip()
if n[len(n) - 1] in v:
	print('YES')
else:
	print('NO')


s = input()
for i in s[::-1]:
	if i.isalpha():
		if i.lower() in {'a', 'e', 'i', 'o', 'u', 'y'}:
			print('YES')
		else:
			print('NO')
		exit(0)


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
for _ in range(1):
	s = input()
	for x in range(len(s) - 1, -1, -1):
		if not s[x].isalpha():
			continue
		else:
			print(['NO', 'YES'][s[x] in 'aeiuoyAEIOUY'])
			break


n = input().split()
n.reverse()
lst = []
z = 'aeiouAEIOUYy'
for i in n:
	if i != '?':
		lst.append(i)
		break
lst[0] = lst[0][::-1]
for j in lst[0]:
	if j != '?':
		if j in z:
			print('YES')
			break
		else:
			print('NO')
			break


o = input()
v = 'aeiouyAEIOUY'
for i in range(len(o) - 1, -1, -1):
	k = o[i]
	if k.isalpha():
		if k in v:
			print('YES')
		else:
			print('NO')
		break


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()
s = input()
for i in range(len(s) - 1, -1, -1):
	if s[i].isalpha():
		ans = s[i] in 'AEIOUYaeiouy'
		break
print(['NO', 'YES'][ans])


s = input()
i = -2
while not s[i].isalpha():
	i -= 1
print('YES' if s[i] in 'AEIOUYaeiouy' else 'NO')


s = input()

def isvowel(x):
	if x in ['a', 'e', 'i', 'o', 'u', 'y']:
		return True
	else:
		return False
for i in s[len(s) - 1:0:-1] + s[0]:
	if i.isalpha():
		if isvowel(i.lower()):
			print('YES')
		else:
			print('NO')
		break


s = input()
s = s.replace(' ', '')
l = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'I', 'E', 'O', 'U', 'Y']
s1 = ''
for char in s:
	if char.isalpha() == True:
		s1 = s1 + char
if s1[len(s1) - 1] in l:
	print('YES')
else:
	print('NO')


s = list(input())
V = ['A', 'a', 'E', 'e', 'I', 'i', 'O', 'o', 'U', 'u', 'Y', 'y']
for i in s[::-1]:
	if i.isalpha():
		if i in V:
			print('YES')
			break
		else:
			print('NO')
			break
	else:
		continue


a = list(input())
l = ['a', 'e', 'i', 'o', 'u', 'y']
a.pop()
z = ''.join(a)
z = z.strip()
if z[-1].lower() in l:
	print('YES')
else:
	print('NO')


question = str(input())
question = question.lower()
tanya = ''.join(question.split())
vowel = ['a', 'i', 'u', 'e', 'o', 'y']
if tanya[-2] in vowel:
	print('YES')
else:
	print('NO')


ques = input().split()
vowels = ['a', 'e', 'i', 'o', 'u', 'y']
if ques[-1] == '?':
	if ques[-2][-1].lower() in vowels:
		print('YES')
	else:
		print('NO')
elif ques[-1][-2].lower() in vowels:
	print('YES')
else:
	print('NO')


q = input()
vowels = 'aeiouyAEIOUY'
for i in q:
	if i.isalpha():
		last = i
if last in vowels:
	print('YES')
else:
	print('NO')


s = list(input())
mas = ['A', 'E', 'I', 'O', 'U', 'Y']
while True:
	if s.count(' ') == 0:
		break
	s.remove(' ')
print(['NO', 'YES'][s[len(s) - 2].upper() in mas])


x = input()
x = x.replace(' ', '')
vowel = set('oiuaeyOIUAEY')
if x[len(x) - 2:len(x) - 1] in vowel:
	print('YES')
else:
	print('NO')


str1 = list(map(str, input().split()))
if str1[len(str1) - 1] == '?':
	k = str1[len(str1) - 2]
	k_len = len(k)
	m = k[k_len - 1]
	if m == 'a' or m == 'e' or m == 'i' or (m == 'o') or (m == 'u') or (m == 'y') or (m == 'A') or (m == 'E') or (m == 'I') or (m == 'O') or (m == 'U') or (m == 'Y'):
		print('YES')
	else:
		print('NO')
else:
	k = str1[len(str1) - 1]
	k_len = len(k)
	m = k[k_len - 2]
	if m == 'a' or m == 'e' or m == 'i' or (m == 'o') or (m == 'u') or (m == 'y') or (m == 'A') or (m == 'E') or (m == 'I') or (m == 'O') or (m == 'U') or (m == 'Y'):
		print('YES')
	else:
		print('NO')


s = input().lower().strip(' ?')
print('YES' if s[-1] in 'aeioyu' else 'NO')


import string
str = input().lower()
vwl = ['a', 'e', 'i', 'o', 'u', 'y']
cvow = False
for i in range(len(str)):
	if str[-i - 1] in string.ascii_lowercase:
		if str[-i - 1] in vwl:
			cvow = True
		break
if cvow:
	print('YES')
else:
	print('NO')


def solve(a):
	s = 'AEIOUY'
	for c in s:
		if a.endswith(c):
			return 'YES'
	return 'NO'
s = str.upper(input())
a = ''
for c in s:
	if 90 >= ord(c) >= 65:
		a += c
print(solve(a))


s = input().lower()
s = list(s)
while s.count(' '):
	s.remove(' ')
if s[-2] == 'a' or s[-2] == 'i' or s[-2] == 'e' or (s[-2] == 'o') or (s[-2] == 'u') or (s[-2] == 'y'):
	print('YES')
else:
	print('NO')


text = str(input())
text = text[::-1]
vowels = ['a', 'e', 'i', 'o', 'u', 'y']
for i in range(0, len(text)):
	if text[i].lower().isalpha():
		if text[i].lower() in vowels:
			print('YES')
			break
		print('NO')
		break


a = input()
k = 'aeiouAEIOUYy'

def fun(string):
	return string.replace(' ', '')
a = fun(a)
if a[-2] in k:
	print('YES')
else:
	print('NO')


def main():
	print(('NO', 'YES')[input()[:-1].rstrip()[-1].lower() in 'aeiouy'])
main()


x = list(input())
i = len(x) - 1
while x[i].isalpha() != 1:
	i -= 1
if x[i].upper() == 'A' or x[i].upper() == 'E' or x[i].upper() == 'I' or (x[i].upper() == 'O') or (x[i].upper() == 'U') or (x[i].upper() == 'Y'):
	print('YES')
else:
	print('NO')


v = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']
s = input()
for x in s:
	s1 = s.replace(' ', '')
if s1[-2] in v:
	print('YES')
else:
	print('NO')