#include <bits/stdc++.h>
int main() {
  char ara[100];
  int len;
  gets(ara);
  len = strlen(ara);
  len = len - 1;
anik:
  len = len - 1;
  if (ara[len] == 'a' || ara[len] == 'e' || ara[len] == 'i' ||
      ara[len] == 'o' || ara[len] == 'u' || ara[len] == 'y')
    printf("YES\n");
  else if (ara[len] == 'A' || ara[len] == 'E' || ara[len] == 'I' ||
           ara[len] == 'O' || ara[len] == 'U' || ara[len] == 'Y')
    printf("YES\n");
  else if (ara[len] == ' ')
    goto anik;
  else
    printf("NO\n");
  return 0;
}
