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