#include <bits/stdc++.h>
using namespace std;
[[maybe_unused]] const int INF = 1e9 + 7;
[[maybe_unused]] const int MOD = 1e9 + 7;
[[maybe_unused]] const int MAXN = 1e6 + 3;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  string s;
  getline(cin, s);
  set<char> v{'A', 'E', 'I', 'O', 'U', 'Y'};
  set<char> c{'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M',
              'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Z'};
  transform(s.begin(), s.end(), s.begin(),
            [](unsigned char x) { return toupper(x); });
  s.erase(remove_if(s.begin(), s.end(),
                    [v, c](unsigned char x) {
                      return ((v.find(x) == v.end()) && (c.find(x) == c.end()));
                    }),
          s.end());
  if (v.find(s.back()) == v.end()) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
}
