#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string str;
  getline(cin, str);
  string vowels = "AEIOUYaeiouy";
  int n = str.length();
  for (int i = n - 2; i >= 0; i--) {
    if (str[i] != ' ') {
      char c = str[i];
      int falg = 0;
      for (char v : vowels) {
        if (c == v) {
          falg = 1;
          break;
        }
      }
      if (falg) {
        cout << "YES";
      } else {
        cout << "NO";
      }
      break;
    }
  }
  return 0;
}
