#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s, prev = "";
  while (cin >> s) {
    if (s.back() != '?') prev = s;
  }
  char c;
  if (s.length() == 1)
    c = prev.back();
  else
    c = s[s.length() - 2];
  if (c == 'a' or c == 'e' or c == 'i' or c == 'o' or c == 'u' or c == 'y' or
      c == 'A' or c == 'E' or c == 'I' or c == 'O' or c == 'U' or c == 'Y') {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
