#include <bits/stdc++.h>
using namespace std;
void solve() {
  string name;
  getline(cin, name);
  for (long long int i = name.size() - 1; i >= 0; i--) {
    if (name[i] >= 'A' && name[i] <= 'Z') {
      if (name[i] == 'A' || name[i] == 'E' || name[i] == 'O' ||
          name[i] == 'I' || name[i] == 'U' || name[i] == 'Y') {
        cout << "YES";
        return;
      } else {
        cout << "NO";
        return;
      }
    }
    if (name[i] >= 'a' && name[i] <= 'z') {
      if (name[i] == 'a' || name[i] == 'e' || name[i] == 'o' ||
          name[i] == 'i' || name[i] == 'u' || name[i] == 'y') {
        cout << "YES";
        return;
      } else {
        cout << "NO";
        return;
      }
    }
  }
}
signed main() {
  long long int t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
