#include <bits/stdc++.h>
using namespace std;
int main() {
  int flag = 0;
  char s[100005];
  gets(s);
  for (int i = strlen(s) - 1; i >= 0; i--) {
    if ((s[i] >= 97 && s[i] <= 122) || (s[i] >= 65 && s[i] <= 90)) {
      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') {
        flag = 1;
      }
      break;
    }
  }
  if (flag == 1)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
