#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int i, j, k;
  char line[200];
  gets(line);
  i = strlen(line);
  while (--i)
    if ((line[i] >= 'a' && line[i] <= 'z') ||
        (line[i] >= 'A' && line[i] <= 'Z'))
      break;
  if (line[i] == 'a' || line[i] == 'e' || line[i] == 'i' || line[i] == 'o' ||
      line[i] == 'u' || line[i] == 'y')
    printf("YES\n");
  else if (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");
  return 0;
}
