#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  getline(cin, s);
  int l = s.length();
  for (int i = l - 1; i >= 0; i--) {
    if (s[i] >= 65 && s[i] <= 90) {
      if (s[i] == 'A' || s[i] == 'E' || s[i] == 'I' || s[i] == 'O' ||
          s[i] == 'U' || s[i] == 'a' || s[i] == 'e' || s[i] == 'i' ||
          s[i] == 'o' || s[i] == 'u' || s[i] == 'Y' || s[i] == 'y') {
        cout << "YES" << endl;
        return 0;
      } else {
        cout << "NO" << endl;
        return 0;
      }
    } else if (s[i] >= 97 && s[i] <= 122) {
      if (s[i] == 'A' || s[i] == 'E' || s[i] == 'I' || s[i] == 'O' ||
          s[i] == 'U' || s[i] == 'a' || s[i] == 'e' || s[i] == 'i' ||
          s[i] == 'o' || s[i] == 'u' || s[i] == 'Y' || s[i] == 'y') {
        cout << "YES" << endl;
        return 0;
      } else {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  return 0;
}
