#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 10e9 + 7;
int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  string s;
  getline(cin, s);
  char f;
  int point = 0;
  for (int i = 0; i < s.length(); i++) {
    if (isalpha(s[i])) {
      point = i;
    }
  }
  int rep = 0;
  for (int i = point; s[i] != '\0'; i--) {
    if (s[i] == 'i' || s[i] == 'I' || s[i] == 'a' || s[i] == 'A' ||
        s[i] == 'e' || s[i] == 'E' || s[i] == 'O' || s[i] == 'o' ||
        s[i] == 'u' || s[i] == 'U' || s[i] == 'Y' || s[i] == 'y') {
      rep = 0;
      break;
    } else {
      rep = 1;
      break;
    }
  }
  if (rep == 0) {
    cout << "YES"
         << "\n";
  } else {
    cout << "NO"
         << "\n";
  }
}
