#include <bits/stdc++.h>
using namespace std;
int main() {
  bool c = false;
  char l;
  string s;
  getline(cin, s);
  for (int i = s.length() - 1; i >= 0; --i) {
    if ((s[i] >= 'A' && s[i] <= 'Z') || (s[i] >= 'a' && s[i] <= 'z')) {
      l = s[i];
      break;
    }
  }
  string st = "AEIOUYaeiouy";
  for (int i = 0; i < st.length(); ++i) {
    if (st[i] == l) {
      c = true;
      break;
    }
  }
  if (c)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
