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