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