#include <bits/stdc++.h>
using namespace std;
bool isprime(int n) {
  if (n < 2) return 0;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return 0;
  return 1;
  return 0;
}
int ls(char s) {
  if (toupper(s) == 'A' || toupper(s) == 'E' || toupper(s) == 'I' ||
      toupper(s) == 'O' || toupper(s) == 'U' || toupper(s) == 'Y')
    return 1;
  return 0;
}
int main() {
  int ca;
  string s;
  getline(cin, s);
  string st;
  for (int i = 0; i < s.size(); i++)
    if ((s[i] >= 'a' && s[i] <= 'z') || (s[i] >= 'A' && s[i] <= 'Z'))
      st.push_back(s[i]);
  if (ls(st[st.size() - 1]))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
