#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  getline(cin, s);
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] >= 'a' and s[i] <= 'z') {
      if (s[i] == 'a' or s[i] == 'e' or s[i] == 'i' or s[i] == 'o' or
          s[i] == 'u' or s[i] == 'y') {
        cout << "YES";
        return 0;
      } else {
        cout << "NO";
        return 0;
      }
    } else if (s[i] >= 'A' and s[i] <= 'Z')
      if (s[i] == 'A' or s[i] == 'E' or s[i] == 'I' or s[i] == 'O' or
          s[i] == 'U' or s[i] == 'Y') {
        cout << "YES";
        return 0;
      } else {
        cout << "NO";
        return 0;
      }
  }
  return 0;
}
