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

class Program
{
    void solve()
    {
        string s = nextLine();
        char z = '!';
        s=s.ToLower();
        for (int i = 0; i < s.Length; i++)
            if (s[i] >= 'a' && s[i] <= 'z')
                z = s[i];
        if ("A, E, I, O, U, Y".ToLower().IndexOf(z) >= 0)
            println("YES");
        else
            println("NO");
    }
    ////////////
    private void println(int[] ar)
    {
        for (int i = 0; i < ar.Length; i++)
        {
            if (i == ar.Length - 1)
                println(ar[i]);
            else
                print(ar[i] + " ");
        }
    }
    private void println(int[] ar, bool add)
    {
        int A = 0;
        if (add)
            A++;
        for (int i = 0; i < ar.Length; i++)
        {
            if (i == ar.Length - 1)
                println(ar[i] + A);
            else
                print((ar[i] + A) + " ");
        }
    }

    private void println(string Stringst)
    {
        Console.WriteLine(Stringst);
    }
    private void println(char charnum)
    {
        Console.WriteLine(charnum);
    }
    private void println(int Intnum)
    {
        Console.WriteLine(Intnum);
    }
    private void println(long Longnum)
    {
        Console.WriteLine(Longnum);
    }
    private void println(double Doublenum)
    {
        string s = Doublenum.ToString(CultureInfo.InvariantCulture);
        Console.WriteLine(s);
    }

    private void print(string Stringst)
    {
        Console.Write(Stringst);
    }
    private void print(int Intnum)
    {
        Console.Write(Intnum);
    }
    private void print(char charnum)
    {
        Console.Write(charnum);
    }
    private void print(long Longnum)
    {
        Console.Write(Longnum);
    }
    private void print(double Doublenum)
    {
        Console.Write(Doublenum);
    }

    string[] inputLine = new string[0];
    int inputInd = 0;
    string nextLine()
    {
        return Console.ReadLine();
    }
    void readInput()
    {
        if (inputInd != inputLine.Length)
            throw new Exception();
        inputInd = 0;
        inputLine = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        if (inputLine.Length == 0)
            readInput();

    }
    int nextInt()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return int.Parse(inputLine[inputInd++]);
    }
    long nextLong()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return long.Parse(inputLine[inputInd++]);
    }
    double nextDouble()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return double.Parse(inputLine[inputInd++]);
    }
    string nextString()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return inputLine[inputInd++];
    }
    static void Main(string[] args)
    {
        Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        new Program().solve();
    }
}

using System;
using System.Linq;

namespace _49A
{
    class Program
    {
        static String removeSpace(String str)
        {
            str = str.Replace(" ", "");
            return str;
        }

        static void Main(string[] args)
        {
            char[] arr = { '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' };
            String str = Console.ReadLine();
            string spaceFree = removeSpace(str);
            char letter = spaceFree[spaceFree.Length - 2];
            Console.WriteLine(arr.Contains(letter) ? "NO" : "YES");

        }
    }
}

using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main()
        {
            string letters = "EIOAYU";
            string quest = Console.ReadLine();
            quest = quest.Trim(new char[] { ' ', '?' }).ToUpper();
            if (letters.Contains(quest[quest.Length-1].ToString()))
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}

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

namespace Activities
{
    class Program
    {
        static void Main(string[] args)
        {
            string question = Console.ReadLine();
            bool foundLast = false;
            char lastLetter = ' ';

            for (int x = question.Length - 1; x >= 0 && foundLast == false; x--)
            {
                if (((Convert.ToInt32(question[x]) >= 65) && (Convert.ToInt32(question[x]) <= 90)) || ((Convert.ToInt32(question[x]) >= 97) && (Convert.ToInt32(question[x]) <= 122)))
                {
                    foundLast = true;
                    lastLetter = question[x];
                }
            }

            if ((lastLetter == 'a') || (lastLetter == 'A') || (lastLetter == 'e') || (lastLetter == 'E') || (lastLetter == 'i') || (lastLetter == 'I') || (lastLetter == 'o') || (lastLetter == 'O') || (lastLetter == 'u') || (lastLetter == 'U') || (lastLetter == 'y') || (lastLetter == 'Y'))
                Console.WriteLine("YES");

            else
                Console.WriteLine("NO");

            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
//using System.Threading.Tasks;

namespace Contest
{

    class Program
    {
        static void Main(string[] args)
        {
            char[] vowels = new char[] { 'A', 'E', 'I', 'O', 'U', 'Y' };
        char[] consonants = new char[] { 'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Z' };

            var s = Console.ReadLine().Replace(" ", "").Reverse();
            //var s = "  Is     it a banana ?".Replace(" ", "").Reverse();
            foreach (var x in s)
            {
                if(vowels.Contains(char.Parse(x.ToString().ToUpper()))){Console.WriteLine("YES");break;}
                 if(consonants.Contains(char.Parse(x.ToString().ToUpper()))){Console.WriteLine("NO");break;}
            }
        }

    }
}

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

namespace _46D2A
{
    class Program
    {
        static void Main(string[] args)
        {
            var t = Console.ReadLine().Split(new char[] { ' ', '?' }, StringSplitOptions.RemoveEmptyEntries);
            if (char.ToLower(t[t.Length - 1][t[t.Length - 1].Length - 1]) == 'a' ||
                char.ToLower(t[t.Length - 1][t[t.Length - 1].Length - 1]) == 'e' ||
                char.ToLower(t[t.Length - 1][t[t.Length - 1].Length - 1]) == 'i' ||
                char.ToLower(t[t.Length - 1][t[t.Length - 1].Length - 1]) == 'o' ||
                char.ToLower(t[t.Length - 1][t[t.Length - 1].Length - 1]) == 'u' ||
                char.ToLower(t[t.Length - 1][t[t.Length - 1].Length - 1]) == 'y')
            {

                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
            Console.ReadLine();
        }
    }
}

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

namespace CR_111_A
{
    class Program
    {

        static void Main()
        {
            string str = Console.ReadLine();
            char[] glasn = { 'A', 'E', 'I', 'O', 'U', 'Y' };
            char[] soglasn = { 'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Z' };
            int place = str.Length-1;
            while (!char.IsLetter(str[place]))
                place--;
            char find = char.ToUpper(str[place]);
            int olo = Array.IndexOf(glasn, find);
            if (olo != -1)
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
        }

    }
}

using System;
using System.Linq;
class Solution
{
    public static void Main()
    {
        char[] st = Console.ReadLine().ToCharArray();
        char[] vovels = { 'A', 'a', 'E', 'e', 'I', 'i', 'O', 'o', 'U', 'u', 'Y', 'y' };
        int index = st.Length - 1;bool searched = false;
        while (st[index] == '?' || st[index] == ' ') index--;
        for(int i = 0; i < 12;i++)
        {
            if (st[index] == vovels[i])
            { searched = true; break; }
        }
        if (searched) Console.WriteLine("YES");
        else Console.WriteLine("NO");
    }
}

using System;
using System.Collections.Generic;

namespace ConsoleApplication25
{
    class Program
    {
        static void Main(string[] args)
        {
            string Ques = Console.ReadLine();
            int i= Ques.Length-2;
            while (!Char.IsLetter(Ques[i])) i--;
                if ((Ques[i] == 'a') || (Ques[i] == 'o') || (Ques[i] == 'u') || (Ques[i] == 'e') || (Ques[i] == 'i') || (Ques[i] == 'y') || (Ques[i] == 'A') || (Ques[i] == 'O') || (Ques[i] == 'U') || (Ques[i] == 'E') || (Ques[i] == 'I') || (Ques[i] == 'Y'))
                    Console.WriteLine("YES");
                else Console.WriteLine("NO");
        }
    }
}

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

namespace ConsoleApplication4
{
    class Program
    {
       static List<char> listglasn = new List<char> { 'A', 'E', 'I', 'O', 'U', 'Y' };
        static void Main(string[] args)
        {
            string text = Console.ReadLine();
            for (int i = text.Length - 1; i >= 0; i--)
            {
                if (char.IsLetter(text[i]))
                {
                    if (listglasn.Contains(Convert.ToChar((text[i].ToString().ToUpper()))))
                    {
                        Console.WriteLine("YES");
                        return;
                    }
                    else
                    {
                        Console.WriteLine("NO");
                        return;
                    }
                }
            }
        }
    }
}

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

namespace Application
{
    class Program
    {
       static List<char> listglasn = new List<char> { 'A', 'E', 'I', 'O', 'U', 'Y' };
        static void Main(string[] args)
        {
            string text = Console.ReadLine();
            for (int i = text.Length - 1; i >= 0; i--)
            {
                if (char.IsLetter(text[i]))
                {
                    if (listglasn.Contains(Convert.ToChar((text[i].ToString().ToUpper()))))
                    {
                        Console.WriteLine("YES");
                        return;
                    }
                    else
                    {
                        Console.WriteLine("NO");
                        return;
                    }
                }
            }
        }
    }
}

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

namespace _49a
{
    class Program
    {
        static void Main(string[] args)
        {
            var toks = Console.ReadLine().ToLower().Replace("?", "").Split(' ');
            var tok = toks.Last(p => p.Trim() != "" && p.Trim() != "?");
            var arr = tok.ToCharArray();
            if (arr[arr.Length - 1] == 'a' || arr[arr.Length - 1] == 'e' || arr[arr.Length - 1] == 'i' || arr[arr.Length - 1] == 'o' || arr[arr.Length - 1] == 'u' || arr[arr.Length - 1] == 'y')
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}

using System; using System.Linq;

class P {
  static void Main() {
    var str = Console.ReadLine();
    var c = str.Last(char.IsLetter);
    Console.Write((new [] {'A', 'E', 'I', 'O', 'U', 'Y'}).Contains(char.ToUpper(c))?"YES":"NO");
  }
}

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

namespace Sleuth
{
    class Program
    {
        static void Main(string[] args)
        {
         here:   string s = Console.ReadLine();
            if(s.Length<1||s.Length>100)
            {
                goto here;
            }
            char[] array = s.ToCharArray();
            for(int i=array.Length-1;i>-1;i--)
            {
                if(array[i]==' '||array[i]=='?')
                {
                    continue;
                }
                    if(array[i]=='B'||array[i]=='C'||array[i]=='D'||array[i]=='F'||array[i]=='J'||array[i]=='H'||array[i]=='G'||array[i]=='K'||array[i]=='L'||array[i]=='M'||array[i]=='N'||array[i]=='P'||array[i]=='Q'||array[i]=='R'||array[i]=='S'||array[i]=='S'||array[i]=='T'||array[i]=='V'||array[i]=='W'||array[i]=='X'||array[i]=='Z'||array[i]=='b'||array[i]=='c'||array[i]=='d'||array[i]=='f'||array[i]=='g'||array[i]=='h'||array[i]=='j'||array[i]=='k'||array[i]=='l'||array[i]=='m'||array[i]=='n'||array[i]=='p'||array[i]=='q'||array[i]=='r'||array[i]=='s'||array[i]=='t'||array[i]=='w'||array[i]=='v'||array[i]=='x'||array[i]=='z')
                    {
                        Console.WriteLine("NO");
                        break;
                    }
                else if(array[i]=='A'||array[i]=='I'||array[i]=='E'||array[i]=='O'||array[i]=='U'||array[i]=='Y'||array[i]=='a'||array[i]=='i'||array[i]=='e'||array[i]=='o'||array[i]=='u'||array[i]=='y')
                {
                    Console.WriteLine("YES");
                    break;
                }
                else
                {
                    continue;
                }
            }
        }
    }
}

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

namespace Tar
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            str = str.ToUpper();
            string vowels = "AEIOUY";
            string cons = "BCDFGHJKLMNPQRSTVWXZ";

            int num = 0;
            for (int i = 0; i < str.Length;i++ )
            {
                if (vowels.IndexOf(str[i]) != -1)
                {
                    num = i;
                }

                if (cons.IndexOf(str[i]) != -1)
                {
                    num = i;
                }
            }

            if (vowels.IndexOf(str[num])!=-1)
            {
                Console.WriteLine("YES");
                return;
            }

            if (cons.IndexOf(str[num]) != -1)
            {
                Console.WriteLine("NO");
                return;
            }
        }
    }

    class Util {
        public static int getNum() {
            return int.Parse(Console.ReadLine());
        }

        public static int[] getArray()
        {
            string[] str = Console.ReadLine().Split(' ');
            int[] array= new int[str.Length];

            for (int i = 0; i < array.Length;i++ )
            {
                try
                {
                    array[i] = int.Parse(str[i]);
                }
                catch(Exception e){
                    //Console.WriteLine(str[i]+"/");
                }
            }

            return array;
        }
    }
}

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

namespace _49A
{
    class Program
    {
        static void Main(string[] args)
        {
            string x = Console.ReadLine();
            string y,c;
            char z;
            int a = 0;
            y = x.Remove(x.IndexOf('?'));
            if (y[y.Length-1]!=' ')
            {
                z = char.Parse(y.Substring(y.Length-1 , 1).ToLower());
            }
            else
            {
                c = y.Trim();
                z = char.Parse(c.Substring(c.Length-1 , 1).ToLower());
            }

            switch (z)
            {
                case 'a':
                    Console.WriteLine("YES");
                    break;
                case 'o':
                    Console.WriteLine("YES");
                    break;
                case 'y':
                    Console.WriteLine("YES");
                    break;
                case 'e':
                    Console.WriteLine("YES");
                    break;
                case 'u':
                    Console.WriteLine("YES");
                    break;
                case 'i':
                    Console.WriteLine("YES");
                    break;
                default:
                    Console.WriteLine("NO");
                    break;
            }
        }
    }
}

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

namespace Sleuth
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            string s = reader.ReadLine();

            for (int i = s.Length - 1; i >= 0; i--)
            {
                if (char.IsLetter(s[i]))
                {
                    writer.WriteLine("AEIOUY".IndexOf(char.ToUpper(s[i])) >= 0 ? "YES" : "NO");
                    break;
                }
            }
            writer.Flush();
        }
    }
}

using System;

namespace vvv
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();

            s = s.Remove(s.Length - 1).TrimEnd().ToLower();

            if (s[s.Length - 1] == 'a' || s[s.Length - 1] == 'e' || s[s.Length - 1] == 'i' ||
                s[s.Length - 1] == 'o' || s[s.Length - 1] == 'u' || s[s.Length - 1] == 'y')
            {
                Console.WriteLine("YES");
            }
            else
                Console.WriteLine("NO");
        }
    }
}

using System;

namespace Сыщик
{
    class Program
    {
        static void Main(string[] args)
        {
            string question = Console.ReadLine().Replace(" ", "");
            if (char.ToUpper(question[question.Length - 2]) == 'A' || char.ToUpper(question[question.Length - 2]) == 'E' || char.ToUpper(question[question.Length - 2]) == 'I' || char.ToUpper(question[question.Length - 2]) == 'O' || char.ToUpper(question[question.Length - 2]) == 'U' || char.ToUpper(question[question.Length - 2]) == 'Y')
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}

using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;

namespace CF317
{
	internal class Program
	{
		private static void Main(string[] args)
		{
			var sr = new InputReader(Console.In);
			//var sr = new InputReader(new StreamReader("input.txt"));
			var task = new Task();
			using (var sw = Console.Out)
				//using (var sw = new StreamWriter("output.txt"))
			{
				task.Solve(sr, sw);
				//Console.ReadKey();
			}
		}
	}

	internal class Task
	{
		public void Solve(InputReader sr, TextWriter sw)
		{
			var glas = new char[] { 'A', 'E', 'I', 'O', 'U', 'Y' };
			var q = sr.NextString();
			var indx = q.Length - 2;
			while(!Char.IsLetter(q[indx]))
			{
				indx--;
			}
			var ch = q[indx];
			if (glas.Contains(ch) || glas.Contains(Char.ToLowerInvariant(ch)) || glas.Contains(Char.ToUpperInvariant(ch)))
			{
				sw.WriteLine("YES");
			}
			else {
				sw.WriteLine("NO");
			}
		}
	}
}

internal class InputReader : IDisposable
{
	private bool isDispose;
	private readonly TextReader sr;

	public InputReader(TextReader stream)
	{
		sr = stream;
	}

	public void Dispose()
	{
		Dispose(true);
		GC.SuppressFinalize(this);
	}

	public string NextString()
	{
		var result = sr.ReadLine();
		return result;
	}

	public int NextInt32()
	{
		return Int32.Parse(NextString());
	}

	public long NextInt64()
	{
		return Int64.Parse(NextString());
	}

	public string[] NextSplitStrings()
	{
		return NextString()
			.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
	}

	public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
	{
		return NextSplitStrings()
			.Select(s => func(s, CultureInfo.InvariantCulture))
			.ToArray();
	}

	public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
	{
		return
			str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
				.Select(s => func(s, CultureInfo.InvariantCulture))
				.ToArray();
	}

	protected void Dispose(bool dispose)
	{
		if (!isDispose) {
			if (dispose)
				sr.Close();
			isDispose = true;
		}
	}

	~InputReader()
	{
		Dispose(false);
	}
}

using System;

class Program
{
    static void Main()
    {
        string input = Console.ReadLine();
        input = input.ToUpper();
        char c = ' ';
        for (int i = input.Length - 2; ; i--)
        {
            if (input[i] != ' ')
            {
                c = input[i];
                break;
            }
        }
        char[] Glasn = {'A', 'E', 'I', 'O', 'U', 'Y'};
        for (int i = 0; i<Glasn.Length; i++)
        {
            if (c == Glasn[i])
            {
                Console.WriteLine("YES");
                //Console.ReadKey();
                return;
            }
        }
        Console.WriteLine("NO");
        //Console.ReadKey();
        return;
    }
}

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

namespace cf
{
    class Program
    {

        static void Main(string[] args)
        {
            try {
                string s = Console.ReadLine().ToUpper();
                char[] ar = { 'A', 'Y', 'E', 'I', 'O', 'U' };
                int c = 0;
                for (int i =s.Length-1; i >=0 ; i--)
                {
                    if(s[i]=='?')
                    {
                        for (int j= i-1; j >=0; j--)
                        {
                            if (s[j] != ' ')
                            {
                                c = j;
                                break;
                            }

                        }
                    }
                }
                bool x = false;
                for (int i = 0; i < 6; i++)
                {
                    if(s[c]==ar[i])
                    {
                        x = true;
                        break;
                    }
                }
                if(x)
                    Console.WriteLine("YES");
                else
                    Console.WriteLine("NO");
            Console.ReadKey();

        }
            catch { }
            }

    }
}

using System;
using System.Collections.Generic;

namespace ConsoleApplication21
{
    class Program
    {
        static void Main(string[] args)
        {
            string Ques = Console.ReadLine();
            int i= Ques.Length-2;
            while (!Char.IsLetter(Ques[i])) i--;
                if ((Ques[i] == 'a') || (Ques[i] == 'o') || (Ques[i] == 'u') || (Ques[i] == 'e') || (Ques[i] == 'i') || (Ques[i] == 'y') || (Ques[i] == 'A') || (Ques[i] == 'O') || (Ques[i] == 'U') || (Ques[i] == 'E') || (Ques[i] == 'I') || (Ques[i] == 'Y'))
                    Console.WriteLine("YES");
                else Console.WriteLine("NO");
        }
    }
}

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

namespace qiw
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                List<char> n = Console.ReadLine().ToCharArray().ToList();
                n.Remove('?');

                    for (int i = n.Count - 1; i >= 0; i--)
                    {

                        if (n[i] == ' ')
                        {
                            n.Remove(n[i]);
                        }
                        else
                        {
                            break;
                        }
                    }
                    int im = n.Count - 1;
                    if (n[im] == 'a' || n[im] == 'A' || n[im] == 'e' || n[im] == 'E' || n[im] == 'i' || n[im] == 'I' || n[im] == 'o' || n[im] == 'O' || n[im] == 'u' || n[im] == 'U' || n[im] == 'y' || n[im] == 'Y')
                    {
                        Console.WriteLine("YES");
                    }
                    else
                    {
                        Console.WriteLine("NO");
                    }

                }

            catch(Exception e){
                Console.WriteLine("NO"); ;
            }

        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;

namespace prA {

    class Program {
#if ONLINE_JUDGE
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
#else
        private static readonly StreamWriter writer = new StreamWriter(@"..\..\output");
        private static readonly StreamReader reader = new StreamReader(@"..\..\input");
#endif
        static void Main(string[] args) {
            string s = reader.ReadLine().ToLower();
            char[] g = {'a', 'e', 'i', 'o', 'u', 'y'};
            char lastChar = '\0';
            for(int i = s.Length - 1; i >= 0; i--) {
                if(Char.IsLetter(s[i])) {
                    lastChar = s[i];
                    break;
                }
            }
            writer.Write(Array.IndexOf(g, lastChar) != -1 ? "YES" : "NO");
            writer.Flush();
#if !ONLINE_JUDGE
            writer.Close();
#endif
        }
        private static int Next() {
            int c;
            int res = 0;
            do {
                c = reader.Read();
                if(c == -1)
                    return res;
            } while(c != '-' && (c < '0' || c > '9'));
            int sign = 1;
            if(c == '-') {
                sign = -1;
                c = reader.Read();
            }
            res = c - '0';
            while(true) {
                c = reader.Read();
                if(c < '0' || c > '9')
                    return res * sign;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();

            if(vowel(str))
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
        }

        public static bool vowel(string s)
        {
            int x = s.Length-1;
            char lastchar;

            while (true)
            {
                if (s[x] == '?' || s[x] == ' ')
                {
                    x--;
                    continue;
                }
                lastchar = Char.ToUpper(s[x]);
                break;
            }

            if (lastchar == 'A' || lastchar == 'E' || lastchar == 'I' || lastchar == 'O' || lastchar == 'U' || lastchar == 'Y')
                return true;
            else
                return false;
        }
    }
}

using System;
using System.Linq;
class Program
{
    static void Main()
    {
        var s = Console.ReadLine().ToUpper();
        int i = s.Length - 1;
        while (!char.IsLetter(s[i])) i--;
        Console.WriteLine(new[] { 'A', 'E', 'I', 'O', 'U', 'Y' }.Contains(s[i]) ? "YES" : "NO");
    }
}

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

namespace ConsoleApplication10
{
    class Program
    {
        static void Main(string[] args)
        {
            List<char> listEnglishAE = new List<char>() {'A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y'};

            string str = Console.ReadLine();

            char[] arrayStr = str.ToCharArray();

            string newStr = "";

            arrayStr = arrayStr.Where(el => el != '?').ToArray();

            foreach (var el in arrayStr)
            {
                newStr += el;
            }

            newStr = newStr.Trim();

            if (listEnglishAE.Contains(newStr.ToCharArray().Last()))
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}

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

class Program
{
    static void Main(string[] args)
    {
        var q = Console.ReadLine().TrimEnd(new[]{'?'}).TrimEnd();

        if ((new[] {'A', 'E', 'I', 'O', 'U', 'Y'}).Contains(char.ToUpper(q[q.Length-1])))
        {
            Console.WriteLine("YES");
        }
        else
        {
            Console.WriteLine("NO");
        }
    }
}

using System;
using System.Linq;

namespace Task49A
{
    class Program
    {
        static void Main(string[] args)
        {
            string inp = Console.ReadLine().Replace(" ",string.Empty);
            char[] vowels = { 'A', 'E', 'I', 'O', 'U', 'Y' };
            Console.WriteLine(vowels.Contains(char.ToUpper(inp[inp.Length-2]))?"YES":"NO");
           // Console.ReadKey();
        }
    }
}

using System;
using System.Linq;
namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            string Example = "AaeEiIoOuUyY";
            string str = Console.ReadLine().Trim(new char[]{ ' ', '?' });
            Console.WriteLine(Example.Contains(str[str.Length-1])?"YES":"NO");
        }
    }
}

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

class Program {
	static void Main() {
		string vowels = "aeiouy";
		string input = Console.ReadLine();
		input = input.ToLower();
		for(int i = input.Length - 1; i >= 0; i--){
			if(input[i] >= 'a' && input[i] <= 'z'){
				foreach(char c in vowels){
					if(c == input[i]){
						Console.WriteLine("YES");
						return;
					}
				}
				break;
			}
		}
		Console.WriteLine("NO");
	}
}

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

namespace ProgrammingContest.Codeforces.Round46
{
    class A
    {
        public static void Main()
        {
            string s = Console.ReadLine();
            string vowels = "aeiouyAEIOUY";
            for (int i = s.Length - 1; i >= 0; i--)
            {
                if (s[i] != '?' && s[i] != ' ')
                {
                    Console.Write(vowels.Contains(s[i]) ? "YES" : "NO");
                    return;
                }
            }
        }
    }
}

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

namespace CodeForce
{
    class _49a
    {
        public static bool IsYes(char c)
        {
            c = char.ToLower(c);
            if (c == 'a' || c == 'e' || c == 'i' || c == 'y' || c == 'u' || c == 'o')
            {
                return true;
            }
            return false;
        }

        public static void Main()
        {
            var line = Console.ReadLine();
            for (var i = line.Length - 1; i >= 0; i--)
            {
                if (char.IsLetter(line[i]))
                {
                    var result = IsYes(line[i]) ? "YES" : "NO";
                    Console.WriteLine(result);
                    return;
                }
            }
        }
    }
}

using System;
using System.Linq;

namespace CSharp
{
    class _49A
    {
        public static void Main()
        {
            Console.WriteLine(new char[] { 'a', 'e', 'i', 'o', 'u', 'y' }.Contains(Console.ReadLine().ToLower().Last(c => char.IsLetter(c))) ? "YES" : "NO");
        }
    }
}

using System;
using System.Collections.Generic;

class Solve
{
    HashSet<char> H = new HashSet<char>();

    public void solve()
    {
        H.Add('A');
        H.Add('E');
        H.Add('I');
        H.Add('O');
        H.Add('U');
        H.Add('Y');

        string s = Console.ReadLine().ToUpper();

        bool ok = false;
        for (int i = 0; i < s.Length; ++i)
            if (s[i] >= 'A' && s[i] <= 'Z')
            {
                ok = H.Contains(s[i]);
            }

        if (ok)
            Console.WriteLine("YES");
        else
            Console.WriteLine("NO");
    }
}

    class Program
    {

        static void Main(string[] args)
        {
            Solve Task = new Solve();
            Task.solve();
           // Console.WriteLine("Done. Press any key..."); Console.ReadKey();
        }
    }

using System;

namespace prog
{
    class Program
    {
        static void Main()
        {
            string s;
            int i;
            char c;

            s = Console.ReadLine();
            s = s.ToUpper();
            for(i = s.Length - 1; s[i] == ' ' || s[i] == '?'; i--);
            c = s[i];
            if (c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U' || c == 'Y')
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
            Console.ReadLine();
        }
    }
}

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

namespace _1
{
    class Program
    {
        static void Main(string[] args)
        {
            String[] s = Console.ReadLine().Split(' ','?');
            string[] g = {  "A", "E", "I", "O", "U", "Y","a","e","i","o","u","y"};

            int n = s.Length - 1;
            while(s[n]=="") n--;

                if (g.Contains(s[n][s[n].Length - 1].ToString()) == true)
                    Console.WriteLine("YES");
                else Console.WriteLine("NO");

                Console.ReadLine();

        }
    }
}

using System;

namespace acs
{
	class MainClass
	{
		public static void Main(string[] args)
		{
			var question = Console.ReadLine();

			bool q_checked = false;
			for (int i = question.Length - 1; i >= 0 && !q_checked; i--) {
				switch (Check(question, i)) {
					case CheckResult.Vowel:
						Console.WriteLine("YES");
						q_checked = true;
						break;
					case CheckResult.Consonant:
						Console.WriteLine("NO");
						q_checked = true;
						break;
				}
			}
		}

		enum CheckResult
		{
			Vowel, Consonant, Other
		}

		static CheckResult Check(string s, int idx)
		{
			var result = CheckResult.Other;
			var ls = s.ToLower();
			switch (ls[idx]) {
				case 'a':
				case 'e':
				case 'i':
				case 'o':
				case 'u':
				case 'y':
					result = CheckResult.Vowel;
					break;
				case 'b':
				case 'c':
				case 'd':
				case 'f':
				case 'g':
				case 'h':
				case 'j':
				case 'k':
				case 'l':
				case 'm':
				case 'n':
				case 'p':
				case 'q':
				case 'r':
				case 's':
				case 't':
				case 'v':
				case 'w':
				case 'x':
				case 'z':
					result = CheckResult.Consonant;
					break;
			}

			return result;
		}
	}
}

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

namespace CodeForce
{
    public class Program
    {
        static void Main(string[] args)
        {
            string input1 = Console.ReadLine();
            Console.WriteLine(Solve(input1));
        }

        /*
            Sleuth
            time limit per test2 seconds
            memory limit per test256 megabytes
            inputstandard input
            outputstandard output
            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.
         */
        public static string Solve(string question)
        {
            var vowels = new HashSet<char>(
                new List<char> { 'A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y' });
            var consonants = new HashSet<char>(
                new List<char>
                {
                    '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'
                });
            var lastChar = question
                .Reverse()
                .SkipWhile(c => !vowels.Contains(c) && !consonants.Contains(c))
                .First();

            return vowels.Contains(lastChar) ? "YES" : "NO";
        }
    }
}

using System;
using System.Linq;

namespace AlgoTasks
{
    class Program
    {
        static void Main(string[] args)
        {
            string q = Console.ReadLine();
            char[] vowels = new char[] { 'A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y' };

            int i = q.Length - 1;
            while (new char[] { ' ', '?' }.Contains(q[i])) i--;
            if (vowels.Contains(q[i]))
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
             string a=Console.ReadLine();
             string glas="aeiouy";
             string sogl="bcdfghjklmnpqrstvwxz";
             bool f=false;
             a=a.ToLower();
             for(int i=0;i<a.Length;i++)
             {
                  for(int j=0;j<glas.Length;j++)
                  {
                       if(a[i]==glas[j])
                       f=false;
                  }
                  for(int j=0;j<sogl.Length;j++)
                  {
                       if(a[i]==sogl[j])
                       f=true;
                  }
             }
             if(f)
             Console.WriteLine("NO");
             else
             Console.WriteLine("YES");

        }
    }
}

//#undef DEBUG

using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

namespace codeforces
{
    class C
    {
        //  test
        static CodeforcesUtils CF = new CodeforcesUtils(
@"
Is   it an apple  and a  banana   simultaneouSLY?
");

        class Solver
        {
            public void Solve()
            {
                string vowels = "AEIOUY";
                string s = CF.ReadLine().ToUpper().Replace(" ","").Replace("?","");
                if (vowels.Contains(s.Substring(s.Length - 1,1)))
                    CF.WriteLine("YES");
                else
                    CF.WriteLine("NO");

            }
        }

        #region test

        static void Main(string[] args)
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("ru-RU");

            new Solver().Solve();
            CF.Close();
        }

        static void TLE()
        {
            for (; ; ) ;
        }

        class CodeforcesUtils
        {
            public string ReadLine()
            {
#if DEBUG
                if (_lines == null)
                {
                    _lines = new List<string>();
                    string[] ss = _test_input.Replace("\n", "").Split('\r');
                    for (int i = 0; i < ss.Length; i++)
                    {
                        if (
                            (i == 0 || i == ss.Length - 1) &&
                            ss[i].Length == 0
                            )
                            continue;

                        _lines.Add(ss[i]);
                    }
                }

                string s = null;
                if (_lines.Count > 0)
                {
                    s = _lines[0];
                    _lines.RemoveAt(0);
                }
                return s;

#else
                //return _sr.ReadLine();
            return Console.In.ReadLine();
#endif
            }

            public void WriteLine(object o)
            {
#if DEBUG
                System.Diagnostics.Trace.WriteLine(o);
#else
                //_sw.WriteLine(o);
            Console.WriteLine(o);
#endif
            }

            public void Write(object o)
            {
#if DEBUG
                System.Diagnostics.Trace.Write(o);
#else
                 //_sw.Write(o);
           Console.Write(o);
#endif
            }

            string _test_input;

            List<string> _lines;

#if DEBUG
            public CodeforcesUtils(string test_input)
            {
                _test_input = test_input;
            }
#else

            public CodeforcesUtils(string dummy)
            {
                //_sr = new System.IO.StreamReader("input.txt");
                //_sw = new System.IO.StreamWriter("output.txt");
            }
#endif

            public void Close()
            {
                if( _sr!= null)
                    _sr.Close();
                if( _sw != null)
                    _sw.Close();
            }

            System.IO.StreamReader _sr=null;
            System.IO.StreamWriter _sw=null;

        }

        #endregion
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        string nextToken()
        {
            string str = "";
            int c;
            do
            {
                c = Console.Read();
                if (c == -1 || ((char)c != ' ' && (char)c != '\n' && (char)c != '\r' && (char)c != '\t')) break;
            } while (true);
            if (c == -1) return str;
            while (true)
            {
                str += (char)c;
                c = Console.Read();
                if (c == -1 || (char)c == ' ' || (char)c == '\n' || (char)c == '\r' || (char)c == '\t') break;
            }
            return str;
        }

        int nextInt()
        {
            return int.Parse(nextToken());
        }

        double nextDouble()
        {
            return double.Parse(nextToken());
        }

        void Solve()
        {
            char[] cc = new char[] { 'A', 'E', 'I', 'O', 'U', 'Y' };
            char t = char.ToUpper(Console.ReadLine().Last(c => c != ' ' && c != '?'));
            Console.WriteLine(cc.Any(c => c == t) ? "YES" : "NO");
        }

        static void Main(string[] args)
        {
#if MY_SUPER_PUPER_ONLINE_JUDGE
            string dir = Directory.GetCurrentDirectory();
            dir = Directory.GetParent(dir).FullName;
            dir = Directory.GetParent(dir).FullName;
            Console.SetIn(new StreamReader(dir + "\\input.txt"));
            Console.SetOut(new StreamWriter(dir + "\\output.txt"));
#endif
            new Program().Solve();
#if MY_SUPER_PUPER_ONLINE_JUDGE
            Console.In.Close();
            Console.Out.Close();
#endif
        }
    }
}

using System;

namespace Search
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			Char[] G = {'A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y'};
			string str = Console.ReadLine();
			int a=str.IndexOf("?");
			if(a>-1)
			{
				for(int i=a-1;i>=0;i--)
				{
					if (System.Text.RegularExpressions.Regex.IsMatch(str[i].ToString(),@"[a-zA-Z]"))
					{
						if(Array.IndexOf(G,str[i])!=-1)
						{
							Console.WriteLine("YES");
							break;
						}else
						{
							Console.WriteLine("NO");
							break;
						}
					}
				}

			}
			else return;
		}
	}
}

using System;

namespace A.Sleuth
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine().ToLower().Replace(" ","").Replace(",","").Replace(".","").Replace("?","").Replace("!","");
            string correct = "aeiouy";
            if(correct.Contains(input[input.Length - 1].ToString()))
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
class some
{
	public static void Main()
	{
		string s=Console.ReadLine();
		char let='a';
		for(int i=s.Length-1;i>=0;i--)
		{
			if(char.IsLetter(s[i]))
			{
				let=s[i];
				break;
			}
		}
		let=char.ToLower(let);
		char[] arr="aeiouy".ToCharArray();
		if(Array.IndexOf(arr,let)>=0)
		Console.WriteLine("YES");
		else
		Console.WriteLine("NO");

	}
}

using System;

namespace lol
{
    class c158Class
    {
        private static void Main()
        {
            string s = Console.ReadLine();
            s = s.Remove(s.Length - 1);
            s = s.TrimEnd();
            char[] v1 = new char[6] { 'A', 'E', 'I', 'O', 'U', 'Y' };
            char[] v2 = new char[6] { 'a', 'e', 'i', 'o', 'u', 'y' };
            int i = s.IndexOfAny(v1, s.Length - 1);
            int j = s.IndexOfAny(v2, s.Length - 1);
            if (i != -1 || j != -1)
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}

using System;
namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine(); char c = ' ';
            for (int i = str.Length - 1; i >= 0; i--) { if (str[i] != '?' && str[i] != ' ') { c = str[i]; break; } }
            if (isVowels(char.Parse(c.ToString().ToLower()))) Console.WriteLine("YES");
            else Console.WriteLine("NO");
        }
        public static bool isVowels(char c)
        {
            return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'y';
        }
    }
}

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

namespace ConsoleApplication30
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string[] ss = { "A"," E", "I", "O", "U", "Y", "a", "e", "i", "o", "u", "y" };
            string[] tt = { "B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", " T", " V", "W", "X", "Z" };
            string c = "";
            for(int i=s.Length-1;i>=0;i--)
            {
                if(s[i]>=65&&s[i]<=90||s[i]>=97&&s[i]<=122){c=Convert.ToString(s[i]);break;}
            } bool f=false;
            for(int i=0;i<ss.Length;i++)
            {
                if(c==ss[i]){f=true;break;}

            }if(f==true)Console.WriteLine("YES");
            else Console.WriteLine("NO");

        }
    }
}

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

namespace A_Snoop
{
    class Program
    {
        static string IsItVowel(string input)
        {
            string[] s = input.Split(' ', '?');
            string lastWord = " "; //= s[s.Length - 2];
            for (int i = s.Length - 1; i >= 0; i--)
                if (s[i].Length != 0) { lastWord = s[i]; break; }

            lastWord = lastWord.ToLower();
            char lastSymbol = lastWord[lastWord.Length - 1];
            int codeOfLast = (int)lastSymbol;
            switch (codeOfLast)
            {
                case 97: return "YES";
                case 101: return "YES";
                case 105: return "YES";
                case 111: return "YES";
                case 117: return "YES";
                case 121: return "YES";
                default: return "NO";
            }
        }
        static void Main(string[] args)
        {
            //Console.WriteLine("{0},{1},{2},{3},{4},{5}",(int)'a', (int)'i', (int)'e', (int)'o', (int)'u', (int)'y');
            Console.WriteLine(IsItVowel(Console.ReadLine()));

        }
    }
}

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

namespace CF_049A {
  class Program {
    static void Main(string[] args) {
      string[] s=Console.ReadLine().Split(new char[] { ' ','?' },StringSplitOptions.RemoveEmptyEntries);
      string o="NO",s2=s[s.Length-1];
      if("AEIOUYaeiouy".IndexOf(s2[s2.Length-1])>-1) o="YES";
      Console.WriteLine(o);
    }
  }
}

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

namespace CodeforcesA
{
    public static class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(ReadLine().TrimEnd('?',' ').ToUpper().Last().In('A', 'E', 'I', 'O', 'U', 'Y') ? "YES" : "NO");
        }

        internal static int[] ReadIntsLine(int numberOfInts, params char[] separators)
        {
            var line = Console.ReadLine();
            return line.Split(separators).Select(s => s.ToInt()).ToArray();
        }

        internal static string ReadLine()
        {
            return Console.ReadLine();
        }

        internal static int ToInt(this string s)
        {
            return Int32.Parse(s);
        }

        internal static int ToInt(this object obj)
        {
            return obj.ToString().ToInt();
        }

        internal static bool In<T>(this T value, params T[] array)
        {
            return array.Contains(value);
        }
    }

}

using System;
using System.Linq;

namespace CodeForces
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new T49A().Run();
        }
    }

    public class T49A
    {
        public void Run()
        {
            var s = Console.ReadLine();
            bool result = Yes(s);
            Console.WriteLine(result?"YES":"NO");
//            Console.WriteLine(Yes("Is it a melon?"));
//            Console.WriteLine(Yes("Is it an apple?"));
//            Console.WriteLine(Yes("  Is     it a banana ?"));
//            Console.WriteLine(Yes("Is   it an apple  and a  banana   simultaneouSLY?"));
        }

        private bool Yes(string s)
        {
            var i = s.IndexOf('?') - 1;
            var gl = "aeiouyAEIOUY".ToCharArray();
            while (true)
            {
                var v = s.Substring(i, 1).ToUpper()[0];
                if (v >= 'A' && v <= 'Z')
                {
                    return gl.FirstOrDefault(c => c == v) != 0;
                }
                --i;
                if(i < 0) return false;
            }
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {

        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string word = "";
            for (int i = 0; i < s.Length; i++)
            {
                if (char.IsUpper(s[i]))
                {
                    word += char.ToLower(s[i]);
                }
                else
                {
                    word += s[i];
                }
            }
            string result = "";
            for (int i = 0; i < word.Length; i++)
            {
                if (char.IsLetter(word[i]))
                {
                    result += word[i];
                }
            }
            if (result[result.Length - 1] == 'a' || result[result.Length - 1] == 'o' || result[result.Length - 1] == 'e' || result[result.Length - 1] == 'i' || result[result.Length - 1] == 'y' || result[result.Length - 1] == 'u')
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}

using System;
namespace ConsoleApplication1
{
    class Program
    {
        static void Main()
        {
            var s = Console.ReadLine();
            var ch=' ';
            for (var i = s.Length-1; i >= 0; i--)
            {
                if(char.IsLetter(s[i]))
                {
                    ch = char.ToLower(s[i]);
                    break;
                }
            }
            Console.WriteLine(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' || ch == 'y' ? "YES" : "NO");
        }
    }
}

using System;
using System.Collections.Generic;

namespace CodeForces
{
	public class Sleuth
	{
		public static void Main (string[] args)
		{
			List<char> vs = new List<char> (){'A', 'E', 'I', 'O', 'U', 'Y'};

			string line = Console.ReadLine();
			line = line.Replace(" ", string.Empty);
			char c = line[line.Length-2];

			if(vs.Contains(c.ToString().ToUpper()[0]))
				Console.WriteLine("YES");
			else
				Console.WriteLine("NO");
		}
	}
}

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

namespace Contesa
{
    class Program
    {
        static void Main(string[] args)
        {
            string input_Value = Console.ReadLine();
          input_Value=  input_Value.ToLower();
          input_Value = input_Value.Replace(" ","");
            int len = input_Value.Length;
            List<char> voules = new List<char>() { 'a', 'o', 'i', 'e', 'y','u' };
            if(voules.Contains (input_Value [len-2]))
                Console .WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}

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

namespace ConsoleApplication5
{
    class Program
    {

        static void Main()
        {
            string s = Console.ReadLine();

            for (int i = s.Length - 2; i >= 0; i--)
            {
                if (s[i] == ' ')
                    continue;
                else
                {
                    if (s[i] == 'a' || s[i] == 'A' || s[i] == 'i' || s[i] == 'I' || s[i] == 'o' || s[i] == 'O' || s[i] == 'e' || s[i] == 'E' || s[i] == 'u' || s[i] == 'U' || s[i] == 'y' || s[i] == 'Y')
                    {
                        Console.WriteLine("YES");
                        break;
                    }
                    else
                    {
                        Console.WriteLine("NO");
                        break;
                    }
                }
            }

        }
    }
}

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

namespace CodeForces
{
    class Sleuth
    {
        char[] vowels = new char[6] { 'a', 'e', 'i', 'o', 'u', 'y' };

        string question;
        public Sleuth(string q)
        {
            question = stripSentence(q.ToLower());
        }

        public string stripSentence(string sentence)
        {
            char[] seperator = { ' ', '?' };
            string stripped = sentence.TrimEnd(seperator);

            return stripped;
        }

        public bool isVowel()
        {
            char cOrV = Convert.ToChar(question.Substring(question.Length - 1));
            foreach (char v in vowels)
            {
                if (cOrV == v)
                {
                    return true;
                }
            }
            return false;
        }
        static void Main(string[] args)
        {
            string mystring = Console.ReadLine();
            Sleuth mySleuth = new Sleuth(mystring);
            if (mySleuth.isVowel())
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}

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

namespace A49
{
    class Program
    {
        static void Main(string[] args)
        {
            String s = Console.ReadLine();
            s = s.Remove(s.Length-1,1).Trim().ToUpper();
            switch (s[s.Length-1])
            {
                case 'A':
                    Console.Write("YES");
                    break;
                case 'E':
                    Console.Write("YES");
                    break;
                case 'I':
                    Console.Write("YES");
                    break;
                case 'O':
                    Console.Write("YES");
                    break;
                case 'U':
                    Console.Write("YES");
                    break;
                case 'Y':
                    Console.Write("YES");
                    break;

                default:
                    Console.Write("NO");

                    break;
            }

        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;

namespace Contest
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine().Replace(" ","").ToLower();
            char[] c = new char[] { 'a', 'e', 'u', 'i', 'o', 'y' };
            Console.WriteLine(c.Contains(s[s.Length - 2]) ? "YES" : "NO");
        }
    }
}

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

namespace Sleuth
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            input = input.Replace(" ", "");
            Console.WriteLine("AEIOUY".Contains(input[input.Length - 2]) || "AEIOUY".ToLower().Contains(input[input.Length - 2]) ? "YES" : "NO");
            Console.ReadLine();
        }
    }
}

// Problem: 49A - Sleuth
// Author: Gusztav Szmolik

using System;

class Sleuth
    {
    public static int Main ()
        {
        string line = Console.ReadLine ();
        if (line == null || line.Length > 100)
            return -1;
        char[] delimiter = new char[] {' '};
        string[] words = line.Split (delimiter,StringSplitOptions.RemoveEmptyEntries);
        byte numWords = Convert.ToByte (words.Length);
        bool existsQMark = false;
        for (byte i = 0; i < numWords; i++)
            {
            byte numChars = Convert.ToByte (words[i].Length);
            for (byte j = 0; j < numChars; j++)
                {
                char c = words[i][j];
                if (!Char.IsLetter (c) && c != '?')
                    return -1;
                if (c == '?' && (existsQMark || (i == 0 && j == 0) || i+1 < numWords || j+1 < numChars))
                    return -1;
                if (c == '?' && !existsQMark)
                    existsQMark = true;
                }
            }
        byte numLastChars = Convert.ToByte (words[numWords-1].Length);
        char lastLetter;
        if (numLastChars > 1)
            lastLetter = words[numWords-1][numLastChars-2];
        else
            {
            numLastChars = Convert.ToByte (words[numWords-2].Length);
            lastLetter = words[numWords-2][numLastChars-1];
            }
        bool ans;
        switch (Char.ToUpper (lastLetter))
            {
            case 'A':
            case 'E':
            case 'I':
            case 'O':
            case 'U':
            case 'Y': ans = true;
                      break;
            default: ans = false;
                     break;
            }
        Console.WriteLine (ans ? "YES" : "NO");
        return 0;
        }
    }

using System;
namespace SolutionsForCodeforces
{
    class Sherlock
    {
        static readonly char[] G = { 'A', 'E', 'I', 'O', 'U', 'Y' };
        static readonly char[] P = { 'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Z' };
        static void Main(string[] args)
        {
            var Question = Console.ReadLine();
            Question = Question.ToUpper();
            while (!char.IsLetter(Question[Question.Length - 1]))
            {
                Question = Question.Remove(Question.Length - 1);
            }
            if (Question.LastIndexOfAny(G) == Question.Length - 1) Console.WriteLine("YES"); else Console.WriteLine("NO");
        }
    }
}

using System;
class Program
{
    static void Main()
    {
        string s = Console.ReadLine();
        int i = 0;
        for (i = s.Length - 2; !Char.IsLetter(s[i]); i--) { }
        Console.WriteLine(Array.IndexOf(new char[] { 'a', 'e', 'i', 'o', 'u', 'y' }, Char.ToLower(s[i])) != -1 ? "YES" : "NO");
    }
}

using System;
class Program
{
    static void Main()
    {
        string s = Console.ReadLine();
        char[] c = { 'a', 'e', 'i', 'o', 'u', 'y' };
        int i = 0;
        for (i = s.Length - 2; !Char.IsLetter(s[i]); i--) { }
        Console.WriteLine(Array.IndexOf(c, Char.ToLower(s[i])) != -1 ? "YES" : "NO");
    }
}

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

namespace A.Сыщик
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int i = s.Length-2;
            while (i>=0)
            {
                if (s[i] != ' ')
                {
                    if (s[i] == 'a' || s[i] == 'A' || s[i] == 'i' || s[i] == 'I' || s[i] == 'o' || s[i] == 'O' || s[i] == 'e' || s[i] == 'E' || s[i] == 'u' || s[i] == 'U' || s[i] == 'y' || s[i] == 'Y')
                    {
                        Console.WriteLine("YES");
                        break;
                    }
                    else
                    {
                        Console.WriteLine("NO");
                        break;
                    }
                }
                i--;
            }
        }
    }
}

using System;
using System.Linq;

namespace _49A
{
    class Program
    {
      /*  static String removeSpace(String str)
        {
            str = str.Replace(" ", "");
            return str;
        }*/

        static void Main(string[] args)
        {
           /* char[] arr = { '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' };
            string str = Console.ReadLine();
            string spaceFree = removeSpace(str);
            char letter = spaceFree[spaceFree.Length - 2];
            Console.WriteLine(arr.Contains(letter) ? "NO" : "YES");*/
            string s= Console.ReadLine(),helper= "AEIOUYaeiouy";
            char letter=' ';
            for (int i = s.Length - 1; i >= 0; i--) {
                if (s[i] != ' ' && s[i] != '?') {
                    letter = s[i];
                    break;
                }
            }
            Console.WriteLine(helper.Contains(letter) ? "YES" : "NO");

        }
    }
}

using System;
using System.Collections.Generic;

namespace ConsoleApplication21
{
    class Program
    {
        static void Main(string[] args)
        {
            string Ques = Console.ReadLine();
            int i= Ques.Length-2;
            while (!Char.IsLetter(Ques[i])) i--;
                if ((Ques[i] == 'a') || (Ques[Ques.Length - 2] == 'o') || (Ques[Ques.Length - 2] == 'u') || (Ques[Ques.Length - 2] == 'e') || (Ques[Ques.Length - 2] == 'i') || (Ques[Ques.Length - 2] == 'y') || (Ques[Ques.Length - 2] == 'A') || (Ques[Ques.Length - 2] == 'O') || (Ques[Ques.Length - 2] == 'U') || (Ques[Ques.Length - 2] == 'E') || (Ques[Ques.Length - 2] == 'I') || (Ques[Ques.Length - 2] == 'Y'))
                    Console.WriteLine("YES");
                else Console.WriteLine("NO");
        }
    }
}

using System; using System.Linq;

class P {
  static void Main() {
    var str = Console.ReadLine();
    var c = str.Last(char.IsLetter);
    Console.Write((new [] {'A', 'E', 'I', 'O', 'U', 'Y'}).Contains(c)?"YES":"NO");
  }
}

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

namespace Tar
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            str = str.ToUpper();
            string vowels = "AEIOUY";
            string cons = "BCDFGHJKLMNPQRSTVWXZ";

            if (vowels.IndexOf(str[str.Length - 2])!=-1)
            {
                Console.WriteLine("YES");
                return;
            }

            if (cons.IndexOf(str[str.Length - 2]) != -1)
            {
                Console.WriteLine("NO");
                return;
            }
        }
    }

    class Util {
        public static int getNum() {
            return int.Parse(Console.ReadLine());
        }

        public static int[] getArray()
        {
            string[] str = Console.ReadLine().Split(' ');
            int[] array= new int[str.Length];

            for (int i = 0; i < array.Length;i++ )
            {
                try
                {
                    array[i] = int.Parse(str[i]);
                }
                catch(Exception e){
                    //Console.WriteLine(str[i]+"/");
                }
            }

            return array;
        }
    }
}

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

namespace _49A
{
    class Program
    {
        static void Main(string[] args)
        {
            string x = Console.ReadLine();
            string y;
            char z;
            y = x.Remove(x.IndexOf('?'));
            if (y[y.Length-1]!=' ')
            {
                z = char.Parse(x.Substring(x.Length - 2, 1).ToLower());
            }
            else
            {
                z = char.Parse(x.Substring(x.Length - 3, 1).ToLower());
            }

            switch (z)
            {
                case 'a':
                    Console.WriteLine("YES");
                    break;
                case 'o':
                    Console.WriteLine("YES");
                    break;
                case 'y':
                    Console.WriteLine("YES");
                    break;
                case 'e':
                    Console.WriteLine("YES");
                    break;
                case 'u':
                    Console.WriteLine("YES");
                    break;
                case 'i':
                    Console.WriteLine("YES");
                    break;
                default:
                    Console.WriteLine("NO");
                    break;
            }
        }
    }
}

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

namespace Sleuth
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            string s = reader.ReadLine();

            for (int i = s.Length - 1; i >= 0; i--)
            {
                if (char.IsLetter(s[i]))
                {
                    if ("AEIOUY".IndexOf(char.ToUpper(s[i])) >= 0)
                    {
                        writer.WriteLine("YES");
                    }
                    else
                    {
                        writer.WriteLine("NO");
                    }
                }
            }
            writer.Flush();
        }
    }
}

using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;

namespace CF317
{
	internal class Program
	{
		private static void Main(string[] args)
		{
			var sr = new InputReader(Console.In);
			//var sr = new InputReader(new StreamReader("input.txt"));
			var task = new Task();
			using (var sw = Console.Out)
				//using (var sw = new StreamWriter("output.txt"))
			{
				task.Solve(sr, sw);
				//Console.ReadKey();
			}
		}
	}

	internal class Task
	{
		public void Solve(InputReader sr, TextWriter sw)
		{
			var glas = new char[] { 'A', 'E', 'I', 'O', 'U', 'Y' };
			var q = sr.NextString();
			if (glas.Contains(q[q.Length - 2]) || glas.Contains(q[q.Length - 2].ToString().ToUpperInvariant()[0]) || glas.Contains(q[q.Length - 2].ToString().ToLowerInvariant()[0]))
			{
				sw.WriteLine("YES");
			}
			else {
				sw.WriteLine("NO");
			}
		}
	}
}

internal class InputReader : IDisposable
{
	private bool isDispose;
	private readonly TextReader sr;

	public InputReader(TextReader stream)
	{
		sr = stream;
	}

	public void Dispose()
	{
		Dispose(true);
		GC.SuppressFinalize(this);
	}

	public string NextString()
	{
		var result = sr.ReadLine();
		return result;
	}

	public int NextInt32()
	{
		return Int32.Parse(NextString());
	}

	public long NextInt64()
	{
		return Int64.Parse(NextString());
	}

	public string[] NextSplitStrings()
	{
		return NextString()
			.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
	}

	public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
	{
		return NextSplitStrings()
			.Select(s => func(s, CultureInfo.InvariantCulture))
			.ToArray();
	}

	public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
	{
		return
			str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
				.Select(s => func(s, CultureInfo.InvariantCulture))
				.ToArray();
	}

	protected void Dispose(bool dispose)
	{
		if (!isDispose) {
			if (dispose)
				sr.Close();
			isDispose = true;
		}
	}

	~InputReader()
	{
		Dispose(false);
	}
}

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

namespace A.Translation
{
    class Program
    {
        static void Main(string[] args)
        {
            string c = Console.ReadLine();
            c.ToUpper();
            char[] r= c.ToCharArray();
            for (int i = r.Length - 1; i >= 1; i--)
            {
                if (r[i]== ' '  || r[i]=='?')
                {
                    continue;
                }
                else if (r[i]=='A'||r[i]=='E' ||r[i]=='I' ||r[i]=='O' ||r[i]=='U' ||r[i]=='Y')
                {
                    Console.Write("YES"+"\n");
                    break;
                }
                else
                {
                    Console.Write("NO" + "\n");
                    break;
                }
            }

        }
    }
}

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

namespace A.Translation
{
    class Program
    {
        static void Main(string[] args)
        {
            string c = Console.ReadLine();
            c.ToLower();
            char[] r= c.ToCharArray();
            for (int i = r.Length - 1; i >= 1; i--)
            {
                if (r[i]== ' '  || r[i]=='?')
                {
                    continue;
                }
                else if (r[i]=='a'||r[i]=='e' ||r[i]=='i' ||r[i]=='o' ||r[i]=='u' ||r[i]=='y')
                {
                    Console.Write("YES"+"\n");
                }
                else
                {
                    Console.Write("NO" + "\n");
                }
            }

        }
    }
}

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

namespace A.Translation
{
    class Program
    {
        static void Main(string[] args)
        {
            string c = Console.ReadLine();
            c.ToLower();
            char[] r= c.ToCharArray();
            for (int i = r.Length - 1; i >= 1; i--)
            {
                if (r[i]== ' '  || r[i]=='?')
                {
                    continue;
                }
                else if (r[i]=='a'||r[i]=='e' ||r[i]=='i' ||r[i]=='o' ||r[i]=='u' ||r[i]=='y')
                {
                    Console.Write("YES"+"\n");
                    break;
                }
                else
                {
                    Console.Write("NO" + "\n");
                    break;
                }
            }

        }
    }
}

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

namespace prog
{
    class Program
    {
        static void Main()
        {
            string s;
            s = Console.ReadLine();
            char c = s[s.Length - 2];
            if (c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U' || c == 'Y')
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
            Console.ReadLine();
        }
    }
}

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

namespace prog
{
    class Program
    {
        static void Main()
        {
            string s;
            s = Console.ReadLine();
            s = s.ToUpper();
            char c = s[s.Length - 2];
            if (c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U' || c == 'Y')
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
            Console.ReadLine();
        }
    }
}

using System;

namespace Search
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			Char[] G = {'A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y'};
			string str = Console.ReadLine();
			int a=str.IndexOf("?");
			if(a>-1)
			{
				char b = str[a-1];
				if(Array.IndexOf(G,b)!=-1)
				{
					Console.WriteLine("YES");
				}else Console.WriteLine("NO");

			}
			else return;
		}
	}
}

using System;

namespace Search
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			Char[] G = {'A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y'};
			string str = Console.ReadLine();
			int a=str.IndexOf("?");
			if(a>-1)
			{
				char b = str[a-1];
				for(int i=a-1;i>=0;i--)
				{
					//if(str[a-i].ToString().is)
					if (System.Text.RegularExpressions.Regex.IsMatch(str[i].ToString(),@"[a-z]"))
					{
						if(Array.IndexOf(G,str[i])!=-1)
						{
							Console.WriteLine("YES");
							break;
						}else
						{
							Console.WriteLine("NO");
							break;
						}
					}
				}

			}
			else return;
		}
	}
}

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

namespace Contesa
{
    class Program
    {
        static void Main(string[] args)
        {
            string input_Value = Console.ReadLine();
          input_Value=  input_Value.ToLower();
          input_Value = input_Value.Replace(" ","");
            int len = input_Value.Length;
            List<char> voules = new List<char>() { 'a', 'o', 'i', 'e', 'y' };
            if(voules.Contains (input_Value [len-2]))
                Console .WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}

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

namespace Contesa
{
    class Program
    {
        static void Main(string[] args)
        {
            string input_Value = Console.ReadLine();
          input_Value=  input_Value.ToLower();
            int len = input_Value.Length;
            List<char> voules = new List<char>() { 'a', 'o', 'i', 'e', 'y' };
            if(voules.Contains (input_Value [len-2]))
                Console .WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}

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

namespace Contesa
{
    class Program
    {
        static void Main(string[] args)
        {
            string input_Value = Console.ReadLine();
          input_Value=  input_Value.ToLower();
          input_Value = input_Value.Replace(' ','X');
            int len = input_Value.Length;
            List<char> voules = new List<char>() { 'a', 'o', 'i', 'e', 'y' };
            if(voules.Contains (input_Value [len-2]))
                Console .WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;

namespace Contest
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine().Replace(" ","");
            char[] c = new char[] { 'a', 'e', 'u', 'i', '0', 'y' };
            Console.WriteLine(c.Contains(s[s.Length - 2]) ? "YES" : "NO");
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;

namespace Contest
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine().Replace(" ","").ToLower();
            char[] c = new char[] { 'a', 'e', 'u', 'i', '0', 'y' };
            Console.WriteLine(c.Contains(s[s.Length - 2]) ? "YES" : "NO");
        }
    }
}

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

namespace A.Сыщик
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int i = s.Length-2;
            while (i>0)
            {
                if (s[i] != ' ')
                {
                    if (s[i] == 'a' || s[i] == 'A' || s[i] == 'i' || s[i] == 'I' || s[i] == 'o' || s[i] == 'O' || s[i] == 'e' || s[i] == 'E' || s[i] == 'u' || s[i] == 'U' || s[i] == 'y' || s[i] == 'Y')
                    {
                        Console.WriteLine("YES");
                        break;
                    }
                    else
                    {
                        Console.WriteLine("NO");
                        break;
                    }
                }
                i--;
            }
        }
    }
}