#include <bits/stdc++.h>
using namespace std;
int main() {
  string st;
  while (getline(cin, st)) {
    int f = 0;
    int s = st.size() - 2;
    if (st[s] == ' ') {
      while (st[s] == ' ') {
        if (st[s - 1] == 'a' || st[s - 1] == 'e' || st[s - 1] == 'i' ||
            st[s - 1] == 'o' || st[s - 1] == 'u' || st[s - 1] == 'y' ||
            st[s - 1] == 'A' || st[s - 1] == 'E' || st[s - 1] == 'I' ||
            st[s - 1] == 'O' || st[s - 1] == 'U' || st[s - 1] == 'Y') {
          f++;
          break;
        }
        s--;
      }
    }
    if (st[s] == 'a' || st[s] == 'e' || st[s] == 'i' || st[s] == 'o' ||
        st[s] == 'u' || st[s] == 'y' || st[s] == 'A' || st[s] == 'E' ||
        st[s] == 'I' || st[s] == 'O' || st[s] == 'U' || st[s] == 'Y') {
      f++;
    }
    if (f == 0)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
  return 0;
}
