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