#include <bits/stdc++.h>
using namespace std;
string a;
int main() {
  getline(cin, a);
  int size = a.length();
  for (int i = size - 2; i >= 0; i--) {
    if (a[i] == ' ') {
      continue;
    }
    a[i] = toupper(a[i]);
    if (a[i] == 'A' || a[i] == 'O' || a[i] == 'U' || a[i] == 'E' ||
        a[i] == 'I' || a[i] == 'Y') {
      cout << "YES";
      return 0;
    } else {
      cout << "NO";
      return 0;
    }
  }
  return 0;
}
