#include <bits/stdc++.h>
using namespace std;
set<char> t = {'A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y'};
string s;
int main() {
  getline(cin, s);
  s.pop_back();
  while (s.back() == ' ') s.pop_back();
  if (t.find(s.back()) != t.end())
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
