#include <bits/stdc++.h>
using namespace std;
const int MN = 2e5 + 5;
const int MOD = 1e9 + 7;
bool isVowel(char c) {
  char vows[] = {'a', 'e', 'i', 'o', 'u', 'y'};
  for (int i = 0; i < 6; i++) {
    if (c == vows[i] || c == vows[i] - 32) return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  getline(cin, s);
  int n = s.size() - 1;
  while (n >= 0) {
    if (s[n] != ' ' && s[n] != '?') {
      if (isVowel(s[n])) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
      break;
    }
    n--;
  }
}
