#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  getline(cin, s);
  reverse(s.begin(), s.end());
  long long flag = 0;
  for (long long i = 0; i < s.length(); i++) {
    if ((s[i] >= 65 && s[i] <= 90) || (s[i] >= 97 && s[i] <= 122))
      if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' ||
          s[i] == 'u' || s[i] == 'y' || s[i] == 'A' || s[i] == 'E' ||
          s[i] == 'I' || s[i] == 'O' || s[i] == 'U' || s[i] == 'Y') {
        cout << "YES";
        flag = 1;
        break;
      } else {
        cout << "NO";
        flag = 2;
        break;
      }
  }
  if (flag == 0) cout << "NO";
}
