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