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