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