#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::ios;
using std::string;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  string s = "";
  getline(cin, s);
  for (int i = 0; i < (int)s.length(); i++) {
    if (s[i] >= 'A' && s[i] <= 'Z') s[i] = s[i] - 'A' + 'a';
  }
  for (int i = (int)s.length() - 1; i >= 0; i--) {
    if (s[i] != ' ' && s[i] != '?') {
      if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' ||
          s[i] == 'u' || s[i] == 'y')
        cout << "YES\n";
      else
        cout << "NO\n";
      break;
    }
  }
  return 0;
}
