#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  getline(cin, s);
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == ' ') {
      s.erase(i, 1);
      i--;
    }
  }
  char x = s[s.size() - 2];
  x = tolower(x);
  if (x == 'a' || x == 'e' || x == 'o' || x == 'i' || x == 'u' || x == 'y')
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
