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