#include <bits/stdc++.h>
using namespace std;
int a, b, c, n, m, x, y, z, q, p, s;
string st;
int main() {
  getline(cin, st);
  n = st.size();
  for (int i = n - 1; i >= 0; i--) {
    if (st[i] <= 'z' && st[i] >= 'a' || st[i] <= 'Z' && st[i] >= 'A') {
      if (st[i] == 'a' || st[i] == 'e' || st[i] == 'i' || st[i] == 'o' ||
          st[i] == 'u' || st[i] == 'y' || st[i] == 'A' || st[i] == 'E' ||
          st[i] == 'I' || st[i] == 'O' || st[i] == 'U' || st[i] == 'Y') {
        cout << "YES";
        return 0;
      } else {
        cout << "NO";
        return 0;
      }
    }
  }
  return 0;
}
