#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int q;
  long long int i, j, k = -1, sum = 0, a, b, c, d = 0, n, count = 0, count1 = 0,
                      sum1 = 0, m, x = 0, y = 0, flag = 0, count2 = 0,
                      count3 = 0;
  string s;
  getline(cin, s);
  for (i = s.size() - 2; i >= 0; i--) {
    if (s[i] != ' ') {
      c = i;
      break;
    }
  }
  if (s[c] == 'a' || s[c] == 'e' || s[c] == 'i' || s[c] == 'o' || s[c] == 'u' ||
      s[c] == 'y' || s[c] == 'A' || s[c] == 'E' || s[c] == 'I' || s[c] == 'O' ||
      s[c] == 'U' || s[c] == 'Y') {
    cout << "YES" << '\n';
  } else {
    cout << "NO" << '\n';
  }
  return 0;
}
