#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  string s;
  getline(cin, s);
  long long n = s.size(), i;
  for (i = n - 1; i >= 0; i--) {
    if (isupper(s[i])) {
      s[i] = tolower(s[i]);
    }
    if (s[i] == '?' || s[i] == ' ') {
      continue;
    } else if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' ||
               s[i] == 'u' || s[i] == 'y') {
      cout << "YES" << endl;
      break;
    } else {
      cout << "NO" << endl;
      break;
    }
  }
}
