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