#include <bits/stdc++.h>
using namespace std;
int main() {
  char buf[1024];
  gets(buf);
  string s(buf, buf + strlen(buf));
  while (s[(int)((s).end() - (s).begin()) - 1] == '?' ||
         s[(int)((s).end() - (s).begin()) - 1] == ' ')
    s.resize(s.size() - 1);
  map<char, bool> used;
  used['a'] = used['e'] = used['i'] = used['o'] = used['u'] = used['y'] = true;
  if (used[(char)tolower(s[(int)((s).end() - (s).begin()) - 1])]) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
