#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  string s;
  string example = "aeiouy";
  getline(cin, s);
  transform(s.begin(), s.end(), s.begin(), ::tolower);
  for (int i = (int)s.size() - 1; i >= 0; --i) {
    if (s[i] == '?' || s[i] == ' ') continue;
    size_t found = example.find(s[i]);
    if (found != string::npos)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
    break;
  }
  return 0;
}
