#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  getline(cin, str);
  str.erase(remove(str.begin(), str.end(), ' '), str.end());
  int n = str.size();
  if (str[n - 2] == 'a' || str[n - 2] == 'e' || str[n - 2] == 'i' ||
      str[n - 2] == 'o' || str[n - 2] == 'u' || str[n - 2] == 'y' ||
      str[n - 2] == 'A' || str[n - 2] == 'E' || str[n - 2] == 'I' ||
      str[n - 2] == 'O' || str[n - 2] == 'U' || str[n - 2] == 'Y') {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
