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