#include <bits/stdc++.h>
using namespace std;
int main() {
  string n;
  getline(cin, n);
  bool last = false;
  for (int i = n.length() - 1; i >= 0; i--) {
    char x = n[i];
    if ((x <= 'z' && x >= 'a') || (x <= 'Z' && x >= 'A')) {
      x = tolower(x);
      switch (x) {
        case 'a':
        case 'e':
        case 'i':
        case 'o':
        case 'u':
        case 'y':
          last = true;
      }
      break;
    }
  }
  if (last) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
