#include <bits/stdc++.h>
using namespace std;
char str[100];
int main() {
  while (gets(str)) {
    int len = strlen(str);
    int flag = 0;
    for (int i = len - 1; i >= 0; --i) {
      if (((str[i] >= 'a' && str[i] <= 'z') ||
           (str[i] >= 'A' && str[i] <= 'Z')) &&
          flag == 0) {
        flag = 1;
        if (str[i] == 'a' || str[i] == 'e' || str[i] == 'i' || str[i] == 'o' ||
            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" << endl;
        else
          cout << "NO" << endl;
      }
    }
  }
  return 0;
}
