#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int main() {
  fast();
  string w;
  getline(cin, w);
  int n = w.length();
  char ch;
  for (int i = n - 1; i >= 0; i--) {
    if (w[i] != ' ' && w[i] != '?') {
      ch = w[i];
      break;
    }
  }
  if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' ||
      ch == 'y' || ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' ||
      ch == 'U' || ch == 'Y') {
    cout << "YES";
  } else
    cout << "NO";
  return 0;
}
