#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[256];
  int n = 0, f = 0;
  cin.getline(s, 255);
  n = strlen(s);
  for (int i = n - 1; i != 0; i--) {
    if (s[i] == ' ' || s[i] == '?') {
    } else {
      f = i;
      break;
    }
  }
  if ((s[f] == 'a') || (s[f] == 'e') || (s[f] == 'i') || (s[f] == 'o') ||
      (s[f] == 'u') || (s[f] == 'y') || (s[f] == 'A') || (s[f] == 'E') ||
      (s[f] == 'I') || (s[f] == 'O') || (s[f] == 'U') || (s[f] == 'Y')) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
