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