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