#include <bits/stdc++.h>
using namespace std;
bool in_array(char arr[], int arr_len, char query) {
  bool is_in = false;
  for (int i = 0; i < arr_len; i++) {
    char lower_case_query = tolower(query);
    if (lower_case_query == arr[i]) {
      is_in = true;
      return is_in;
    }
  }
  return is_in;
}
int main() {
  char vowels[] = {'a', 'e', 'i', 'o', 'u', 'y'};
  string question = "";
  getline(cin, question, '\n');
  int index_to_check = 0;
  for (int i = 0; i < question.length(); i++) {
    if (question[i] == ' ' || question[i] == '?') {
      continue;
    } else {
      index_to_check = i;
    }
  }
  if (in_array(vowels, 6, question[index_to_check])) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
