#include <bits/stdc++.h>
using namespace std;
bool vowel(char c) {
  return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' ||
          c == 'y' || c == 'A' || c == 'E' || c == 'I' || c == 'O' ||
          c == 'U' || c == 'Y');
}
int main() {
  string question;
  getline(cin, question);
  int index = question.size() - 1;
  for (int i = index; i >= 0; i--) {
    if ((question[i] >= 65 && question[i] <= 90) ||
        (question[i] >= 97 && question[i] <= 122)) {
      index = i;
      break;
    }
  }
  (vowel(question[index])) ? cout << "YES" << endl : cout << "NO" << endl;
  return 0;
}
