#include <bits/stdc++.h>
char ch[1000010];
const char ans[] = {"aeiouyAEIOUY"};
int main() {
  gets(ch);
  int n = strlen(ch);
  int pos = 0;
  for (pos = n - 1; pos; pos--)
    if (ch[pos] >= 'A' && ch[pos] <= 'Z' || ch[pos] >= 'a' && ch[pos] <= 'z')
      break;
  bool fail = 1;
  for (int i = 0; i < 12; i++)
    if (ch[pos] == ans[i]) fail = 0;
  puts(fail ? "NO" : "YES");
  return 0;
}
