#include <bits/stdc++.h>
using namespace std;
int main() {
  string c;
  int i;
  getline(cin, c);
  i = c.length() - 2;
  while (c[i] == ' ' || c[i] == '?') {
    i--;
  }
  if (c[i] == 'a' || c[i] == 'e' || c[i] == 'i' || c[i] == 'o' || c[i] == 'u' ||
      c[i] == 'y' || c[i] == 'A' || c[i] == 'E' || c[i] == 'I' || c[i] == 'O' ||
      c[i] == 'U' || c[i] == 'Y')
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
