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