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