#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  getline(cin, s);
  int v = s.size() - 2;
  string k = " ";
  while (s[v] == k[0]) v--;
  if (s[v] == 'A' || s[v] == 'I' || s[v] == 'O' || s[v] == 'U' || s[v] == 'E' ||
      s[v] == 'Y' || s[v] == 'a' || s[v] == 'i' || s[v] == 'e' || s[v] == 'u' ||
      s[v] == 'o' || s[v] == 'y')
    cout << "YES\n";
  else
    cout << "NO\n";
}
