#include <iostream>
#include <map>

using namespace std;

int main() {

  int t;

  cin >> t;

  map<long long,bool> xs;

  for (long long i = 1; i < 10000; i++){
    xs[i*i*i] = true;
  }

  while(t--){
    long long x;
    bool a = false;
    cin >> x;

    for(long long i = 1; i*i*i < x; i++){
      if(xs[x-i*i*i]){
        a = true;
        break;
      }
    }
    if(a){
      cout << "YES\n";
    }else{
      cout << "NO\n";
    }
  }

  return 0;
}