#include <bits/stdc++.h>
using namespace std;
template <typename T>
T mod(T t) {
  return t > 0 ? t : -t;
}
template <typename T>
T moddif(T n, T m) {
  return n - m > 0 ? n - m : m - n;
}
void solve() {
  string s, temp = "AEIOUYaeiouy";
  getline(cin, s);
  int len = s.length() - 2;
  while (s[len] == ' ') len--;
  cout << (((temp.find(s[len])) == -1) ? "NO" : "YES");
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  ;
  int q = 1;
  while (q--) solve();
}
