#include <bits/stdc++.h>
int main() {
  char line[101];
  scanf("%[^\n]s", line);
  int len = strlen(line);
  if (line[len - 2] == 'a' || line[len - 2] == 'e' || line[len - 2] == 'i' ||
      line[len - 2] == 'o' || line[len - 2] == 'u' || line[len - 2] == 'y' ||
      line[len - 2] == 'A' || line[len - 2] == 'E' || line[len - 2] == 'I' ||
      line[len - 2] == 'O' || line[len - 2] == 'U' || line[len - 2] == 'Y')
    printf("YES\n");
  else if (line[len - 2] == ' ') {
    int i = len - 3;
    while (line[i] == ' ') i--;
    if (line[i] == 'a' || line[i] == 'e' || line[i] == 'i' || line[i] == 'o' ||
        line[i] == 'u' || line[i] == 'y' || line[i] == 'A' || line[i] == 'E' ||
        line[i] == 'I' || line[i] == 'O' || line[i] == 'U' || line[i] == 'Y')
      printf("YES\n");
    else
      printf("NO\n");
  } else
    printf("NO\n");
  return 0;
}
