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