#include <bits/stdc++.h>
using namespace std;
bool isVowel(string a) {
  int n = a.length();
  char x = a[n - 2];
  if (x == ' ') {
    int i = 1;
    while (x == ' ') {
      x = a[n - 2 - i];
      i++;
    }
  }
  x = tolower(x);
  if (x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u' || x == 'y')
    return true;
  return false;
}
int main() {
  string a;
  getline(cin, a);
  if (isVowel(a))
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
