#include <bits/stdc++.h>
using namespace std;
int main() {
  string x;
  getline(cin, x);
  int idx;
  for (int i = x.size() - 1; i >= 0; i--) {
    if (x[i] != ' ' && x[i] != '?') {
      idx = i;
      break;
    }
  }
  x[idx] = tolower(x[idx]);
  if (x[idx] == 'a' || x[idx] == 'e' || x[idx] == 'i' || x[idx] == 'o' ||
      x[idx] == 'u' || x[idx] == 'y')
    printf("YES\n");
  else
    printf("NO\n");
}
