#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");
  ;
  string t;
  size_t i;
  getline(cin, t, '\n');
  while ((i = t.find(' ')) != string::npos) t.erase(i, 1);
  s = t;
  reverse(s.begin(), s.end());
  for (int i = 0; i < s.size(); i++) s[i] = tolower(s[i]);
  for (int i = 0; i < s.size(); i++) {
    if (s[i] >= 65 and s[i] <= 122) {
      if (s[i] == 'a' or s[i] == 'e' or s[i] == 'u' or s[i] == 'i' or
          s[i] == 'y' or s[i] == 'o') {
        cout << "YES";
        ;
        return 0;
        ;
      } else {
        cout << "NO";
        ;
        return 0;
        ;
      }
    }
  }
}
