#include <bits/stdc++.h>
using namespace std;
long long int a, b, c, d, n, i, cnt = 0, snt = 0;
float f, flo, fload = 0;
string s, h, o, name;
int main() {
  ios_base::sync_with_stdio(0);
  setlocale(LC_ALL, "Russian");
  ;
  size_t i;
  getline(cin, s, '\n');
  while ((i = s.find(' ')) != string::npos) s.erase(i, 1);
  while ((i = s.find('?')) != string::npos) s.erase(i, 1);
  for (int i = 0; i < s.size(); i++) s[i] = tolower(s[i]);
  reverse(s.begin(), s.end());
  if (s[0] == 'a' or s[0] == 'e' or s[0] == 'u' or s[0] == 'i' or s[0] == 'y' or
      s[0] == 'o')
    cout << "YES";
  else
    cout << "NO";
}
