#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  getline(cin, s);
  int i;
  for (i = s.size() - 1; i >= 0; i--) {
    if (s[i] == ' ' || s[i] == '?')
      continue;
    else
      break;
  }
  s[i] = tolower(s[i]);
  if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u' ||
      s[i] == 'y')
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
