#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  getline(cin, a);
  for (int i = a.size() - 1; i > -1; i--) {
    if (isalpha(a[i])) {
      a[i] = toupper(a[i]);
      if (a[i] == 'A' or a[i] == 'E' or a[i] == 'I' or a[i] == 'O' or
          a[i] == 'U' or a[i] == 'Y') {
        cout << "YES";
        return 0;
      }
      cout << "NO";
      return 0;
    }
  }
}
