#include <bits/stdc++.h>
int main() {
  char x[101];
  int i = 0, n, flag = 0;
  while (1) {
    scanf(" %c", &x[i]);
    if (x[i] == '?') {
      break;
    }
    i++;
  }
  for (n = i - 1; i > 0; n--) {
    if (x[n] == ' ') {
    } else {
      break;
    }
  }
  switch (x[n]) {
    case 'a':
    case 'A':
    case 'e':
    case 'E':
    case 'o':
    case 'O':
    case 'i':
    case 'I':
    case 'u':
    case 'U':
    case 'y':
    case 'Y':
      printf("YES");
      break;
    default:
      printf("NO");
  }
}
