#include <bits/stdc++.h>
using namespace std;
string s, t = "AEIOUYaeiouy";
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  getline(cin, s);
  int i = s.size() - 2;
  while (s[i] == ' ') i--;
  cout << (t.find(s[i]) != -1 ? "YES" : "NO");
}
