#include <bits/stdc++.h>
using namespace std;
const long long MX = 2e5 + 5;
const long long INF = 1e18;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s = "", a;
  getline(cin, a);
  transform(a.begin(), a.end(), a.begin(), ::tolower);
  for (auto c : a) {
    if (c != ' ') {
      s += c;
    }
  }
  long long n = s.size() - 2;
  if (s[n] == 'a' || s[n] == 'e' || s[n] == 'i' || s[n] == 'o' || s[n] == 'u' ||
      s[n] == 'y') {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << "s\n";
  return 0;
}
