#include <bits/stdc++.h>
int main() {
  char line[105];
  gets(line);
  int len;
  len = strlen(line);
  int c = len - 2;
  for (; c > 0; c--)
    if (line[c] != ' ') break;
  len = c;
  if ((line[len] == 'a') || (line[len] == 'e') || (line[len] == 'i') ||
      (line[len] == 'o') || (line[len] == 'u') || (line[len] == 'A') ||
      (line[len] == 'E') || (line[len] == 'I') || (line[len] == 'O') ||
      (line[len] == 'U') || (line[len] == 'y') || (line[len] == 'Y')) {
    printf("YES");
  } else
    printf("NO");
  return 0;
}
