#include <bits/stdc++.h>
int find(char c) {
  if (c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U' || c == 'Y') {
    return 1;
  } else if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' ||
             c == 'y') {
    return 1;
  } else {
    return 0;
  }
}
int main() {
  char s[105], c;
  int i = 0;
  scanf("%[^\n]s", &s[0]);
  while (s[i] != '?') {
    i++;
  }
  for (int j = i - 1; j >= 0; j--) {
    if ((s[j] >= 65 && s[j] <= 90) || (s[j] >= 97 && s[j] <= 122)) {
      c = s[j];
      break;
    }
  }
  if (find(c) == 1) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
