#include <bits/stdc++.h>
char cad[100000];
char cub[100000];
bool verificador() {
  int lon = strlen(cad);
  int pos = 0;
  for (int i = 0; i < lon; i++) {
    if (cad[i] != 32 && cad[i] != 63) {
      cub[pos] = cad[i];
      pos++;
    }
  }
  int lon2 = strlen(cub);
  if (cub[lon2 - 1] == 'Y' || cub[lon2 - 1] == 'y' || cub[lon2 - 1] == 'a' ||
      cub[lon2 - 1] == 'A' || cub[lon2 - 1] == 'e' || cub[lon2 - 1] == 'E' ||
      cub[lon2 - 1] == 'i' || cub[lon2 - 1] == 'I' || cub[lon2 - 1] == 'o' ||
      cub[lon2 - 1] == 'O' || cub[lon2 - 1] == 'u' || cub[lon2 - 1] == 'U') {
    return true;
  } else {
    return false;
  }
}
int main() {
  gets(cad);
  if (verificador() == true) {
    printf("YES");
  } else {
    printf("NO");
  }
}
