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