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