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