#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[100], g;
  for (int i = 0; i < 100; i++) {
    cin >> s[i];
  }
  int y = 0;
  while (!s[y].empty()) ++y;
  y--;
  if (s[y] == "?")
    g = s[y - 1];
  else
    g = s[y];
  char z;
  if (g[g.size() - 1] == '?')
    z = g[g.size() - 2];
  else
    z = g[g.size() - 1];
  if (z == 'A' || z == 'E' || z == 'I' || z == 'Y' || z == 'U' || z == 'O' ||
      z == 'a' || z == 'e' || z == 'i' || z == 'y' || z == 'u' || z == 'o')
    cout << "YES";
  else
    cout << "NO";
}
