        var t = readline();
        for (var i=0; i<t; i++){
            var s = readline();
            var result = s.toLowerCase()
            if (result == 'yes'){
                print('YES');
            }else{
                print('NO');
            }
        }

var n = parseInt(readline());

for (var i = 0; i < n; i++) {
    var str = readline();

    if (str.toUpperCase() === "YES") {
        print("YES");
    } else {
        print("NO");
    }
}

var t = readline();
for(var i =0 ; i < t ; i++){
    var yes = readline().toUpperCase();
    if (yes === 'YES') {
        print('YES');
    } else {
        print('NO');
    }
}

    var limit = parseInt(readline());
    for (var i = 0; i < limit; i++)
    {
        var input = readline();
        if ((input[0] === 'y' || input[0] === 'Y') &&
                (input[1] === 'e' || input[1] === 'E') &&
                (input[2] === 's' || input[2] === 'S'))
                    { print("YES");}
                    else {print("NO");}
    }

const length = Number(readline())

const input = ((length) => Array.from({ length: length }, () => readline()))(length)

const solution = (input) => {
  const result = input.map(str => str.toUpperCase() === 'YES' ? 'YES' : 'NO')
  return result.join('\n')
}

print(solution(input))

var a = readline();
var arr = [];
for(var i = 0; i < a; i++){
    arr[i] = readline().toUpperCase();
    if(arr[i][0]=="Y" && arr[i][1]=="E" && arr[i][2]=="S"){
        print("YES");
    }else{
        print("NO");
    }
}

var test = readline();
for (var i = 1; i <= test; i++) {
    var s = readline();
    if (s.toUpperCase() == 'YES') {
        print('YES');
    } else print('NO')
}

var testCase = +readline()
var dataStruct = [{
    u: "Y",
    l: "y"
  }, {
    u: "E",
    l: "e"
  },
  {
    u: "S",
    l: "s"
  }
]

loop0:
for(var i=0;i<testCase;i++){
    var sequence=readline(),counter=0
    loop1:
    for(var j=0;j<sequence.length;j++){
        loop2:
        for(var k=0;k<dataStruct.length;k++){
            if((sequence[j]===dataStruct[k]["u"]||sequence[j]===dataStruct[k]["l"])&&j===k){
            counter++
            break loop2
            }

        }
    }
    counter===3?print("Yes"):print("No")
}

w = readline();
str = "YES"
for (i = 0; i < w; i++){
    strE = readline().toUpperCase();
if  (str === strE){
    print ("YES");
} else {
  print ("NO");
}
}

var t = readline();
var input ;
for(var i = 0 ; i < t ; i++) {
input = readline().toLowerCase();
if(input == 'yes'){
    print('YES');
}
else{
    print('NO');
}
}

t = readline();
while(t--){
    x = readline().toLowerCase();
    if(x === 'yes')
        print('YES');
    else
        print("NO");
}

var tests = parseInt(readline());
    for (var t=0; t<tests;t++) {
        var yes = readline();
        if (/^YES$/i.test(yes)) {
            print('YES');
        } else {
            print('NO');
        }
    }

n = parseInt(readline());

for(i = 0; i < n; i++) {
    var word = readline();
    var modWord = word.toLowerCase();
    if(modWord === "yes") {
        print('YES');
    } else {
        print('NO');
    }
}

var t = +readline();

for(var i = 0; i< t; i ++) {

    var t2 = readline();
    if (checkStr(t2)){
          print('YES')
    }else {
          print('NO')
    }

}

function checkStr(str) {

  return str[0].toLowerCase() == 'y' && str[1].toLowerCase() == 'e' && str[2].toLowerCase() == 's'

}

T = readline()

while(T--){
      ans = 'NO'
      str  = readline().toUpperCase()
      if(str === 'YES')
            ans = "YES"

      print(ans)
}

process.stdin.on("data", (data) => {
  const [testCount, ...lines] = data.toString().trim().split("\n");
  for (let line of lines) {
    console.log(line.toLowerCase().trim() == "yes" ? "YES" : "NO");
  }
});

process.stdin.resume();
process.stdin.setEncoding("ascii");

_input = "";
process.stdin.on("data", function (input) {
   _input += input;
});

process.stdin.on("end", function () {
    processData(_input);
});

function processData(input) {
    const lines = input.split("\n");
    for (let i = 1; i <= lines[0]; i++) {
        processTC(lines, i);
    }
}

function processTC(lines, startLine) {
    const str = lines[startLine];
    console.log((str.trim().toLowerCase() === "yes") ? "YES" : "NO");
}

function Solution() {
  const arr = lines.slice(1);
  const res = [];
  for (let i = 0; i < arr.length; i++) {
    if (arr[i].toUpperCase() === 'YES') res.push('YES')
    else res.push('NO');
  }
  return res.join('\n');
}

const readline = require('readline')

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
})
const lines = []
rl.on('line', (input) => {
  lines.push(input);
})
rl.on('close', () => {
  console.log(Solution());
});

function Solution() {
  const strArr = lines.slice(1);
  const res = [];
  for (let str of strArr) {
    if (str.toUpperCase() === 'YES') res.push('YES');
    else res.push('NO');
  }
  return res.join('\n');
}

const readline = require('readline')

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
})
const lines = []
rl.on('line', (input) => {
  lines.push(input);
})
rl.on('close', () => {
  console.log(Solution());
});

function Solution() {
  const N = Number(lines[0]);
  const strArr = lines.slice(1);
  const res = [];
  for (let i = 0; i < N; i++) {
    const [a, b, c] = strArr[i];
    if ((a === 'y' || a === 'Y')
    && (b === 'e' || b === 'E')
    && (c === 's' || c === 'S')) {
      res.push('YES');
    } else {
      res.push('No');
    }
  }
  return res.join('\n');
}

const readline = require('readline')

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
})
const lines = []
rl.on('line', (input) => {
  lines.push(input);
})
rl.on('close', () => {
  console.log(Solution());
});

const readline = require("readline");

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

rl.on("line", line => {
    if (!isNaN(Number(line))) {
        // do nothing
    } else if (line.toLowerCase() === "yes") {
        console.log("YES");
    } else {
        console.log("NO");
    }
});

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}
function main(){
    let t = readline()-0
    while(t--){
        let s = readline()
        if(s.toLowerCase() === "yes")
            console.log("YES")
        else
            console.log("NO")
    }
}

// Parsing input: https://codeforces.com/blog/entry/78878
process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

function readLine() {
    return inputString[currentLine++];
}

function main() {
    // Actual body code
    var T = parseInt(readLine());

    for (var t = 0; t < T; ++t) {
        var s = readLine();
        console.log((s.trim().toLowerCase() == "yes") ? "YES" : "NO");
    }
}

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

const readline = require("readline");
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false,
});

let c = 0;

rl.on("line", (d) => {
  if (c === 0) {
    c++;
    return;
  }
  const ans = d.toLowerCase() === "yes" ? "YES" : "NO";
  console.log(ans);
  c++;
});

rl.on("close", () => {});

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readLine() {
    return inputString[currentLine++];
}
//////////////////////////////////////////////////////////////

const myWordsArray = [];

const transformWord = (longWord)=>{
    const FirstLetter = longWord.charAt(0);
    const lastLetter = longWord.charAt(longWord.length -1);
    const middle = longWord.length - 2;
    console.log(`${FirstLetter}${middle}${lastLetter}`);
}

const validateWords = (word)=>{
    if(word.length > 10){
        transformWord(word)
    }else{
        console.log(word)
    }
}

function main() {
    let number = parseInt(readLine());
    while(number--)
    {
        let string = readLine();
        string.toLowerCase() == 'yes' ? console.log("YES") : console.log("NO");
    }
}

const readline = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});

let input = [];
let ans = [];

readline.on('line', line => {
    input.push(line);
}).on('close', ()=>{
    for (let i = 1; i < input.length; i++) {
        ans.push(input[i].toLowerCase() === 'yes' ? 'YES' : 'NO');
    }
    console.log(ans.join('\n'));
});

const readline = require('readline');
const { stdin: input, stdout: output } = require('process')
const rl = readline.createInterface({ input, output })

let lines = []

const createReadLine = () => {
  i = 0;
  return () => lines[i++]
}

rl.on('line', line => lines.push(line))

rl.on('close', () => {
  const readLine = createReadLine();
  let t = parseInt(readLine())
  while (t--) {
    let str = readLine();
    console.log(str.toLowerCase() === 'yes' ? 'yes' : 'no');
  }
})

const { readFileSync, writeFileSync } = require("fs")

let a = readFileSync("./input.fd0138e687.txt","utf-8").match(/[a-z]+/gi)

for (let i = 0; i < a.length; ++i) {
    a[i] = /^yes$/i.test(a[i]) ? "YES" : "NO"
}

console.log( a.join("\r\n") )

/*
** Template
*/

// Common Template Starts //
//*
process.stdin.resume();
process.stdin.setEncoding("utf-8");

let inputString = "";
let currentLine = 0;

process.stdin.on("data", (inputStdin) => {
    inputString += inputStdin;
});

process.stdin.on("end", (_) => {
    inputString = inputString
        .trim()
        .split("\n")
        .map((string) => {
            return string.trim();
        });

    main();
});

function readline() {
    return inputString[currentLine++];
}
// Common Template Ends //

// LIBRARY START //

const isOdd = (x) => { return x & 1 }
const isEven = (x) => { return !(x & 1) }

const reverseText = (s) => { return s.split('').reverse().join('') }
const hasDuplicates = (str) => (/([a-z])\1/i).test(str)

const hasDuplicateChar = (str, char) => str.indexOf(char) !== str.lastIndexOf(char)

const isSorted = arr => arr.every((v, i, a) => !i || a[i - 1] <= v);

const findAllIndicesOfChar = (str, char) => {
    str = str.split('')
    let indices = [];
    for (let i = 0; i < str.length; i++) {
        if (str[i] === char) indices.push(i);
    }
    return indices
}

const splitAt = index => x => [x.slice(0, index), x.slice(index)]

const isUpper = str => !/[a-z]/.test(str) && /[A-Z]/.test(str)

const escapeRegExp = (string) => string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&')

const replaceAll = (str, find, replace) => str.replace(new RegExp(escapeRegExp(find), 'g'), replace)

const findUnique = (str) => {
    return [...str].reduce((acc, curr) => {
        return acc.includes(curr) ? acc : acc + curr;
    }, "")
}

// LIBRARY END

const getresult = (str) => {

    str = str.toLowerCase()

    return str === 'yes' ? 'YES' : 'NO'
}

function main() {
    let testcases = parseInt( readline() )
    while( testcases-- ){

        let str = readline()
        console.log( getresult( str ) )
    }
}
//*/

let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL);
    var n = lines[0]
    for(j = 1; j <= n; j ++){
        var e = false
        var s = lines[j].split('')
        if(s[0] == 'y' || s[0] == 'Y'){
            if(s[1] == 'e' || s[1] == 'E'){
                if(s[2] == 's' || s[2] == 'S'){
                    e = true
                }
            }
        }
        if(e === true){
            console.log('YES')
        }else{
            console.log('NO')
        }
    }

});

let stop = '';
process.stdin.on('data', c => stop += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = stop.split(EOL);
    var t = lines[0];
    for(i = 1; i <= t; i++){
        var a = lines[i].split('');
        var y = a[0], e = a[1], s = a[2];
        var check = 0;
        if(y == 'y' || y == 'Y'){
            check++;
        }
        if(e == 'e' || e == 'E'){
            check++;
        }
        if(s == 's' || s == 'S'){
            check++;
        }
        console.log(check == 3 ? 'YES' : 'NO');
    }
});

let data = '';
process.stdin.on('data', c => data += c);

function* nextLine() {
	let lines = data.trim().split(/\n/g);
	for(let l of lines){
		yield l.trim();
	}
}

let nl = nextLine();

nl.elem = function(funParse) {
		return funParse(this.next().value);
	};

nl.array = function(funParse) {
		return this.next().value.split(/\s/g).map(funParse||(x => x));
	};

nl.num = function() {
		return nl.elem(Number);
	};

nl.nums = function() {
		return nl.array(Number);
	};

nl.line = function() {
		return this.next().value;
	};

const sol = () => {
	//your code this
	let t = nl.num();
	let ans = [];
	for(let i = 0; i < t; i++){
		let a = nl.line().toLowerCase();
		ans.push(a === 'yes');
	}
	console.log(ans.map(x => x?'YES':'NO').join('\n'));
};

process.stdin.on('end', sol);

'use strict';

const fs = require('fs');

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', function(inputStdin) {
    inputString += inputStdin;
});

process.stdin.on('end', function() {
    inputString = inputString.split('\n');

    main();
});

function readLine() {
    return inputString[currentLine++];
}

function isPossible(n, x, heights) {
    heights.sort();
    heights.sort(function(a, b) {
        return a - b;
      });
    // //console.log(heights)

    let front = []
    let back = []

    for (let i = 0; i < heights.length; i++) {
        if (i < n) {
            front.push(heights[i])
        } else {
            back.push(heights[i])
        }
    }

    // //console.log(front)
    // //console.log(back)
    for (let j = 0; j < front.length; j++) {
        if (back[j] - front[j] < x) {
            // //console.log(back[j] + " " + front[j])
            return "NO";
        }
    }

    return "YES";
}

function calc(a, m) {
    let s = "";
    for (let index = 0; index < m; index++) {
        s += "B"
    }

   for (let index = 0; index < a.length; index++) {
        let ai = a[index];

        if (ai < (m + 1 - ai)) {
            let _s = s.replaceAt(ai - 1, "A");
            if (compare(_s, s) < 0) {
                s = _s;
                continue;
            } else if (compare(_s, s) >= 0) {
                    let __ss = s.replaceAt(m + 1 - ai - 1, "A");
                    if (compare(__ss, s) < 0) {
                        s = __ss;
                        continue;
                    }
            }
         }  else {
            let _s = s.replaceAt(m + 1 - ai - 1, "A");
            if (compare(_s, s) < 0) {
                s = _s;
                continue;
            }  if (compare(_s, s) >= 0) {
                    let __ss = s.replaceAt(ai - 1, "A");
                    if (compare(__ss, s) < 0) {
                        s = __ss;
                        continue;
                    }
            }
    }
}

   return s;
}

function compare(s1, s2) {
    return s1.localeCompare(s2)
}

String.prototype.replaceAt = function(index, replacement) {
    return this.substring(0, index) + replacement + this.substring(index + replacement.length);
}

function main() {
    // const ws = fs.createWriteStream(process.env.OUTPUT_PATH);

    const test_cases = parseInt(readLine().trim(), 10);

    for (let gItr = 0; gItr < test_cases; gItr++) {
        // const n_m = readLine().replace(/\s+$/g, '').split(' ').map(arrTemp => parseInt(arrTemp, 10));
        // const n = n_m[0];
        // const m = n_m[1];

        // if ((n >= 1 && n <= 50) && (m >= 1 && m <= 50)) {
        // const val = readLine().replace(/\s+$/g, '').split(' ').map(arrTemp => parseInt(arrTemp, 10));
        const val = readLine().trim()
        if (val.toUpperCase() == "YES") console.log("YES")
        else console.log("NO")
        // let output = calc(val, m);
        // console.log(output)
        // }
        // ws.write(result + '\n');
    }

    // ws.end();
}

"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");

function print(x) {
  console.log(x);
}
let inputString = "";
let currentLine = 0;

process.stdin.on("data", (inputStdin) => {
  inputString += inputStdin;
});
process.stdin.on("end", () => {
  inputString = inputString.split("\n");
  main();
});
function readline() {
  return inputString[currentLine++];
}

// ********** Code Start **********

function main() {
    var tests = parseInt(readline());
    for (let t = 0;t < tests; ++t) {
        var s = readline();
        let arr = Array.from(s);
        if ((arr[0] == 'Y' || arr[0] == 'y') &&
            (arr[1] == 'E' || arr[1] == 'e') &&
            (arr[2] == 'S' || arr[2] == 's')) {
              console.log(
                'YES'
              );
        } else {
          console.log('NO');
        }
    }
}

const readline = require('readline')

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})
const lines = []
rl.on('line', (input) => {
    lines.push(input);
})
rl.on('close', () => {
// (function() {
    // const lines = require('fs').readFileSync('test.in', 'utf8').split('\n')
    let l = 0;
    let t = +lines[l++]
    const output = []
    for (let i = 0; i < t; i++) {
        const str = lines[l++]
        output[i] = solve(str)
    }
    console.log(output.join('\n'))
// })()
})

function solve(str) {
    return str.toUpperCase() === 'YES' ? 'YES' : 'NO'
}

// https://stackoverflow.com/questions/20086849/how-to-read-from-stdin-line-by-line-in-node
// // cat .\input.txt | node .\script.js
const state = { i: 0 }
const readline = require('readline');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    terminal: false
});
rl.on('line', function (line) {
    if (state.i > 0) {
        let sum = 0
        let data = line.split('')
        if (data[0] == 'y' || data[0] == 'Y') sum++
        if (data[1] == 'e' || data[1] == 'E') sum++
        if (data[2] == 's' || data[2] == 'S') sum++
        if (sum == 3) console.log("YES")
        if (sum != 3) console.log("NO")
    }
    state.i++
})

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}
const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let arr = readline().trim();
    let a1 = false,
      a2 = false,
      a3 = false;
    if (arr[0] === "Y" || arr[0] === "y") a1 = true;
    if (arr[1] === "E" || arr[1] === "e") a2 = true;
    if (arr[2] === "S" || arr[2] === "s") a3 = true;
    if (a1 && a2 && a3) console.log("YES");
    else console.log("NO");
  }
};
solve();

const fs = require("fs");
const input = fs.readFileSync(0, 'utf8').trim().split('\r\n');
let currentline = 0;
function readline(){
      return input[currentline++];
}

function alph() {
  var f = 'abcdefghijklmnopqrstuvwxyz';
  return f;
}
function Alph() {
  var f = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  return f;
}
function max(x,y) {
  return x >=y ? x : y;
}
function min(x,y) {
  return x <=y ? x : y;
}
function abs(x) {
  return x < 0 ? x*(-1) : x;
}
// console.log(input)
var T = readline();
// var inf = 1000000000000;
for(var tc=1;tc<=T;tc++) {
  // var nul = readline();
  var n = readline()//.split(' ').map((x) => parseInt(x));
  // var a = readline().split(' ').map((x) => parseInt(x));
  if(n.toUpperCase() == "YES") console.log("YES");
  else console.log("NO");
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on('end', (_) => {
  inputString = inputString
    .trim()
    .split('\n')
    .map((string) => {
      return string.trim();
    });

  main();
});

function readline() {
  return inputString[currentLine++];
}

function main() {
  let times = parseInt(readline());
  for (let i = 0; i < times; i++) {
    let word = readline().toUpperCase();
    console.log(word === 'YES' ? 'YES' : 'NO');
  }
}

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = []; var outputList = [];var retcode = new Set();
read.on('line', function(input){
	var tmp = input.split(' ');
	for(var i = 0; i < tmp.length; i++){
		inLine.push(tmp[i]);
		if(i == tmp.length - 1){
			retcode.add(inLine.length);
		}
	}
});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
	console.log(myconv(outputList, 9));
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextArray(size, code){
	var ret = new Array(size);
	for(var i = 0; i < size; i++){
		if(code == 'int'){
			ret[i] = nextInt();
		}else if(code == 'long'){
			ret[i] = nextLong();
		}else if(code == 'double'){
			ret[i] = nextDouble();
		}else{
			ret[i] = next();
		}
	}
	return ret;
}
function nextIntArray(size){return nextArray(size, 'int');} function nextStrArray(size){return nextArray(size, 'str');} function nextLongArray(size){return nextArray(size, 'long');} function nextDoubleArray(size){return nextArray(size, 'double');}
function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();} function nextInt(){return myconv(next(),1);} function nextLong(){return BigInt(next());} function nextDouble(){return parseFloat(next());}
function getCountMap(list){
	var map = {};
	for(var i = 0; i < list.length; i++){
		if(map[list[i]] == null){
			map[list[i]] = 0;
		}
		map[list[i]]++;
	}
	return map;
}
function init(input){
	return {
		list : input, index : 0, max : input.length,
		hasNext : function(){return (this.index < this.max);},
		next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}},
		isReturn : function(){return retcode.has(this.index);}
	};
}
function myout(s){outputList.push(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
function isReturn(){return obj.isReturn();}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
	var t = nextInt();
	while(hasNext()){
		var S = next().toUpperCase();
		if(S == 'YES'){
			myout("YES");
		}else{
			myout("NO");
		}
	}
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function output(x) {
    if (typeof x !== 'string') {
        x = x.toString();
    }
    //process.stdout.write(x);   // without auto '\n' (newline)
    console.log(x);  // with auto '\n' (newline)
}

function main() {
    let N = readline();

    for (let test = 0; test < N; test++) {
        const str = readline();
        output(str.toLowerCase() === 'yes' ? 'YES' : 'NO');
    }
}

const length = Number(readline())
const input = ((length) => Array.from({ length: length }, () => readline()))(length)

const solution = (input) => {
  const result = input.map(str => {
    str.toUpperCase() === 'YES' ? 'YES' : 'NO'
  })

  return result.join('\n')
}

print(solution(input))

let testCount;

process.stdin.on("data", (data) => {
  if (!testCount) {
    testCount = +data.toString();
    return;
  }
  console.log(testCount, line.toLowerCase().trim() == "yes" ? "YES" : "NO");

  const input = data.toString().trim();
  const lines = input.split("\n");
  for (let line of lines) {
    console.log(line.toLowerCase().trim() == "yes" ? "YES" : "NO");
  }

  testCount--;
});

let testCount;

process.stdin.on("data", (data) => {
  if (!testCount) {
    testCount = +data.toString();
    return;
  }

  const input = data.toString().trim();
  const lines = input.split("\n");
  for (let line of lines) {
    console.log(line.toLowerCase().trim() == "yes" ? "YES" : "NO");
  }

  testCount--;
});

let firstRun = true;

process.stdin.on("data", (data) => {
  if (firstRun) {
    firstRun = false;
    return;
  }

  const input = data.toString().trim();
  const lines = input.split("\n");
  for (let line of lines) {
    console.log(line.toLowerCase().trim() == "yes" ? "YES" : "NO");
  }
});

let numTests = null;
let curTest = 0;

process.stdin.on("data", (data) => {
  if (numTests === null) {
    numTests = parseInt(data.toString());
    return;
  }
  const input = data.toString().trim();
  const lines = input.split("\n");
  for (let line of lines) {
    console.log(line.toLowerCase().trim() == "yes" ? "YES" : "NO");
  }

  curTest++;
  if (curTest >= numTests) {
    process.exit();
  }
});

process.stdin.on("data", (data) => {
  const input = data.toString().trim();
  const lines = input.split("\n");
  for (let line of lines) {
    console.log(line.toLowerCase().trim() == "yes" ? "YES" : "NO");
  }
});

process.stdin.on("data", (data) => {
  const input = data.toString().trim();
  const lines = input.split("\n");
  for (let line of lines) {
    console.log("line", line.toLowerCase().trim());

  }
});

process.stdin.on("data", (data) => {
  const input = data.toString().trim();
  const lines = input.split("\n");
  for (let line of lines) {
    console.log(line.toLowerCase() === "yes" ? "YES" : "NO");
  }
});

process.stdin.on("data", (data) => {
  const input = data.toString().trim();
  const lines = input.split("\n");
  for (let line of lines) {
    console.log("line: ", line);
  }
});

process.stdin.on("data", (data) => {
  const input = data.toString().trim();
  console.log("Input: ", input);
});

process.stdin.on("data", (data) => {
  console.log("Input: ", data);
});

let i = "";
let o = "";
process.stdin.on("data", (c) => (i += c));
process.stdin.on("end", () => {
  const lines = i.toString().trim();

  for (let line of lines) {
    if (line.toLowerCase().trim() === "yes") {
      o += "YES\n";
    } else {
      o += "NO\n";
    }
  }
  console.log(o);
});

const stdin = process.openStdin();

stdin.addListener("data", function (d) {
  const line = d.toString().trim();
  if (line.toLowerCase().trim() === "yes") {
    console.log("YES");
  } else {
    console.log("NO");
  }
});

process.stdin.resume();
process.stdin.setEncoding("ascii");

_input = "";
process.stdin.on("data", function (input) {
   _input += input;
});

process.stdin.on("end", function () {
    processData(_input);
});

function processData(input) {
    const lines = input.split("\n");
    for (let i = 1; i <= lines[0]; i++) {
        processTC(lines, i);
    }
}

function processTC(lines, startLine) {
    const str = lines[startLine];
    console.log((str.toLowerCase() === "yes") ? "YES" : "NO");
}

process.stdin.resume();
process.stdin.setEncoding("ascii");

_input = "";
process.stdin.on("data", function (input) {
   _input += input;
});

process.stdin.on("end", function () {
    processData(_input);
});

function processData(input) {
    const lines = input.split("\n");
    for (let i = 1; i <= lines[0]; i++) {
        processTC(lines, i);
    }
}

function processTC(lines, startLine) {
    const str = lines[startLine];
    return (str.toLowerCase() === "yes") ? "YES" : "NO";
}

process.stdin.resume();
process.stdin.setEncoding("ascii");

_input = "";
process.stdin.on("data", function (input) {
   _input += input;
});

process.stdin.on("end", function () {
    processData(_input);
});

function processData(input) {
    const lines = input.split("\n");
    for (let i = 1; i <= lines[0]; i++) {
        processTC(lines, i);
    }
}

function processTC(lines, startLine) {
    const str = lines[startLine];
    return (str.toLowerCase() === "yes");
}

const readline = require("readline");

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

rl.on("line", line => {
    if (!isNaN(Number(line))) {
        console.log(Number(line));
    };
    if (line.toLowerCase() === "yes") {
        console.log("YES");
    } else {
        console.log("NO");
    }
});

const readline = require("readline");

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

rl.on("line", line => {
    if (line.toLowerCase() === "yes") {
        console.log("YES");
    } else {
        console.log("NO");
    }
});


var nm = readline().trim().split(' ').map((_x)=>parseInt(_x));
var n=nm[0],m=nm[1];
var s=[];
var crossed = [];
for(var i=0;i<n;i++){
 s.push(readline().trim().split(''))
 var bools= [];
 for(var j=0;j<m;j++){
     bools.push(false)
 }
 crossed.push(bools)
}
//print(s)

for(var i=0;i<n;i++){
    for(var j=0;j<m;j++){
        for(var k=i+1;k<n;k++){
            if(s[i][j]==s[k][j]){
                crossed[i][j]=true
                crossed[k][j]=true
            }
        }
        for(var k=j+1;k<m;k++){
            if(s[i][j]==s[i][k]){
                crossed[i][j]=true
                crossed[i][k]=true
            }
        }
    }
}
//print(crossed)

var ans = '';

for(var i=0;i<n;i++){
    for(var j=0;j<m;j++){
  //      print(crossed[i][j],s[i][j])
        if(!crossed[i][j])
            ans+=s[i][j];
    }
}

print(ans)


;(function () {

        print((function (n, k) {
                var t = 0;
                while (n--) {

                        for (var i = 0, s = readline(), f = true; i <= k; i++)
                                if (s.indexOf(i) === -1) {
                                        f = false;
                                        break;
                                }

                        t += f;
                }

                return t;
        }).apply(null, readline().split(' ').map(Number)));

}).call(this);

print(function(n, k) {
	var i, j, c, s, ans = 0;
	for (i = 0; i < n; i++) {
		s = 0;
		c = new Int8Array(10);

		readline().split('').forEach(function(v) {
			c[v] = 1;
		});

		for (j = 0; j <= k; j++) {
			s += c[j];
		}
		if (s === k + 1) {
			ans++;
		}
	}

	return ans;
}.apply(0, readline().split(' ').map(Number)));

var num = readline().split(' ').map(c => parseInt(c)),count = 0
var encap = [0,0,0,0,0,0,0,0,0,0], bag = new Set()
for (var j = 0; j < num[0]; j++){
	readline().split('').map(c => bag.add(parseInt(c)))
	bag.forEach(c => encap[c] += 1)
	var res = encap.reduce((sum,val,index) =>{
		if (index < num[1]+1) return sum + val
		else return sum
	},0)
	if (res >= num[1]+1){
		count += 1
	}
	encap.fill(0)
	bag.clear()
}
print(count)

'use strict';
process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

const readLine=()=> inputString[currentLine++];
/* ================================================
           Main Solution Starts Here
===================================================*/

const main=()=>{
	let [n,k]=readLine().split(" ").map(n=>+n)
	let ans=0
	while(n--){
		let counter=0
		let x=readLine()
		for(let i=0;i<=k;i++)
			if(x.search(i-'0')!=-1)
				counter++
		if(counter==(k+1))
			ans++
	}
	console.log(ans)
}

(function(n, k) {
    var i, j, exist, s, ans = 0;
    for (i = 0; i < n; i++) {
        s = 0;
        exist = [];

        readline().split('').forEach(function(v) {
            exist[v] = 1;
        });

        for (j = 0; j <= k; j++) {
            s += exist[j];
        }
        if (s === k + 1) {
            ans++;
        }
    }

    print(ans);
}).apply(0, readline().split(' ').map(Number));

var values = readline().split(" ").map(Number);
var n = values[0];
var k = values[1];
count = 0;

while (n--) {
    var arr = Array.from(new Set(readline().split('').map(Number))).sort((a, b) => a - b);
    var needed = arr.slice(0, k + 1);
    if (needed[0] === 0 &&
        needed[needed.length - 1] === k &&
        needed.length === k + 1) {
          count++;
        }
}

print(count);

'use strict';
process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

const readLine=()=> inputString[currentLine++];
/* ================================================
           Main Solution Starts Here
===================================================*/

const main=()=>{
	let [n,k]=readLine().split(" ").map(n=>+n)
	let count=0
	while(n--){
		let isGood=true
		let number = +readLine()
		while(number){
			let digit = number%10
			if(digit>k)
			{
				isGood=false
				break
			}
			number/=10
		}
		if(isGood)
			count++
	}
	console.log(count)
}

print(function(n, k) {
	var i, j, c, s, ans = 0;
	for (i = 0; i < n; i++) {
		s = 0;
		c = new Int8Array(10);

		readline().split('').forEach(function(v) {
			c[v] = 1;
		});

		for (j = 0; j < k; j++) {
			s += c[j];
		}
		if (s === k) {
			ans++;
		}
	}

	return ans;
}.apply(0, readline().split(' ').map(Number)));

var num = readline().split(' ').map(c => parseInt(c)),count = 0
var encap = [0,0,0,0,0,0,0,0,0,0]
for (var j = 0; j < num[0]; j++){
	var array = readline().split('').map(c => parseInt(c))
	array.sort((a,b) => {return a-b}).forEach(v => encap[v]+=1)
	var res = encap.reduce((sum,val,index) =>{
		if (index < num[1]+1) return sum + val
		else return sum
	},0)
	if (res >= num[1]+1){
		count += 1
	}
	encap.fill(0)
}
print(count)

var num = readline().split(' ').map(c => parseInt(c)),count = 0
var encap = [0,0,0,0,0,0,0,0,0,0]
for (var j = 0; j < num[0]; j++){
	var array = readline().split('').map(c => parseInt(c))
	array.forEach(v => encap[v]+=1)
	var res = encap.reduce((sum,val,index) =>{
		if (index < num[1]+1) return sum + val
		else return sum
	},0)
	if (res == num[1]+1){
		count += 1
	}
	encap.fill(0)
}
print(count)

var values = readline().split(" ").map(Number);
var n = values[0];
var k = values[1];
count = 0;

while (n--) {
    var arr = Array.from(new Set(readline().split('').map(Number))).sort((a, b) => a - b);
    if (arr[0] === 0 &&
        arr[arr.length - 1] === k &&
        arr.length === k + 1) {
          count++;
        }
}

print(count);

var values = readline().split(" ").map(Number);
var n = values[0];
var k = values[1];
count = 0;

while (n--) {
    var arr = Array.from(new Set(readline().split('').map(Number))).sort((a, b) => a - b);
    var needed = arr.slice(0, k + 1);
    if (arr[0] === 0 &&
        needed[needed.length - 1] === k) {
          count++;
        }
}

print(count);


//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = []; var outputList = [];var retcode = new Set();
read.on('line', function(input){
	var tmp = input.split(' ');
	for(var i = 0; i < tmp.length; i++){
		inLine.push(tmp[i]);
		if(i == tmp.length - 1){
			retcode.add(inLine.length);
		}
	}
});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
	console.log(myconv(outputList, 9));
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextArray(size, code){
	var ret = new Array(size);
	for(var i = 0; i < size; i++){
		if(code == 'int'){
			ret[i] = nextInt();
		}else{
			ret[i] = next();
		}
	}
	return ret;
}
function nextIntArray(size){return nextArray(size, 'int');} function nextStrArray(size){return nextArray(size, 'str');}
function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();} function nextInt(){return myconv(next(),1);}
function init(input){
	return {
		list : input, index : 0, max : input.length,
		hasNext : function(){return (this.index < this.max);},
		next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}},
		isReturn : function(){return retcode.has(this.index);}
	};
}
function myout(s){outputList.push(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
function isReturn(){return obj.isReturn();}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
	var t = nextInt();
	for(var i = 0; i < t; i++){
		var N = nextInt();
		var M = nextInt();
		var alist = nextIntArray(N);
		var blist = nextIntArray(N);
		var clist = nextIntArray(M);
		var diff = {};
		var colorMap = {};
		for(var j = 0; j < N; j++){
			if(colorMap[alist[j]] == null){
				colorMap[alist[j]] = new Set();
			}
			colorMap[alist[j]].add(j);
			if(alist[j] != blist[j]){
				if(diff[blist[j]] == null){
					diff[blist[j]] = [];
				}
				diff[blist[j]].push(j);
			}
		}

		var keep = [];
		var output = [];
		for(var j = 0; j < M; j++){
			var c = clist[j];
			if(diff[c] == null || diff[c].length == 0){
				if(colorMap[c] != null && colorMap[c].size > 0){
					var te = Array.from(colorMap[c]);
					while(keep.length > 0){
						output.push(te[0] + 1);
						keep.pop();
					}
					output.push(te[0] + 1);
				}else{
					keep.push(c);
				}
			}else{
				var ok = diff[c].shift();
				while(keep.length > 0){
					output.push(ok + 1);
					keep.pop();
				}
				output.push(ok + 1);
				colorMap[alist[ok]].delete(ok);
				if(colorMap[c] == null){
					colorMap[c] = new Set();
				}
				colorMap[c].add(ok);
			}
		}
		//myerr(diff);
		var key = Object.keys(diff);
		var isOK = true;
		for(var j = 0; j < key.length; j++){
			if(diff[key[j]].length > 0){
				isOK = false;
				break;
			}
		}
		if(!isOK || output.length != M){
			myout("NO");
		}else{
			myout("YES");
			myout(myconv(output, 8));
		}
	}
}

'use strict';

function solve(n, m, a, b, c) {
  const colors = new Map(),
        change = new Map(),
        painters = new Map();
  for (let [i, color] of b.entries()) {
    colors.set(color, i);
    if (a[i] !== b[i]) {
      var _change$get;
      if (!change.has(color)) change.set(color, []);
      (_change$get = change.get(color)) === null || _change$get === void 0 ? void 0 : _change$get.push(i);
    }
  }
  for (let color of c) {
    var _painters$get;
    painters.set(color, ((_painters$get = painters.get(color)) !== null && _painters$get !== void 0 ? _painters$get : 0) + 1);
  }
  for (let [color, arr] of change) {
    var _painters$get2;
    if (arr.length > ((_painters$get2 = painters.get(color)) !== null && _painters$get2 !== void 0 ? _painters$get2 : 0)) return 'NO';
  }
  let res = [],
      last = -1;
  for (let i = m - 1; i >= 0; i--) {
    const color = c[i],
          idx = change.get(color);
    if (idx !== null && idx !== void 0 && idx.length) {
      res[i] = idx.pop();
    } else if (last !== -1) {
      res[i] = last;
    } else {
      if (colors.has(color)) {
        res[i] = colors.get(color);
      } else {
        return 'NO';
      }
    }
    if (last === -1) last = res[i];
  }
  return `YES\n${res.map(num => num + 1).join(' ')}`;
}

async function main(read) {
  try {
    let res = [];
    let t = Number(await read());
    while (t--) {
      const [n, m] = (await read()).split(' ').map(Number);
      const a = (await read()).split(' ').map(Number);
      const b = (await read()).split(' ').map(Number);
      const c = (await read()).split(' ').map(Number);
      res.push(solve(n, m, a, b, c));
    }
    console.log(res.join('\n'));
  } catch (error) {
    console.log(error);
  }
}

let inputs,
    str = '';
function read() {
  return inputs.next().value.trim();
}
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', input => str += input);
process.stdin.on('end', () => {
  inputs = str.split('\n').values();
  main(read);
});

var dataitr;
var stdin_input = "";
process.stdin.resume();
process.stdin.setEncoding("ascii");
process.stdin.on("data", function (input) { stdin_input += input; });
process.stdin.on("end", function () { dataitr = stdin_input.split('\n').values(); main(); });

const rl = () => dataitr.next().value.trim();
const rn = () => Number(rl());
const ra = () => rl().split(' ');
const rna = () => ra().map(x => Number(x));

function main () {
	let T = rn();
	while (T--) {
		const [n, m] = rna();
		const a = rna();
		const b = rna();
		const c = rna();

		const need = Array.from(Array(n+1), x => []);
		let done = n;
		for (let i = 0; i < n; i++) {
			if (a[i] != b[i]) {
				need[b[i]].push(i+1);
				done--;
			}
		}

		let splplk;
		if (need[c[m-1]].length) {
			splplk = need[c[m-1]][0];
		} else {
			for (let i = 0; i < n; i++) {
				if (b[i] == c[m-1]) {
					splplk = i+1;
					break;
				}
			}
			if (!splplk) {
				console.log('NO');
				continue;
			}
		}

		const ans = Array(m);
		for (let i = 0; i < m; i++) {
			if (need[c[i]].length) {
				ans[i] = need[c[i]].pop();
				done++;
			} else {
				ans[i] = splplk;
			}
		}

		console.log(done == n ? 'YES\n' + ans.join(' ') : 'NO');
	}
}

var dataitr;
var stdin_input = "";
process.stdin.resume();
process.stdin.setEncoding("ascii");
process.stdin.on("data", function (input) { stdin_input += input; });
process.stdin.on("end", function () { dataitr = stdin_input.split('\n').values(); main(); });

const rl = () => dataitr.next().value.trim();
const rn = () => Number(rl());
const ra = () => rl().split(' ');
const rna = () => ra().map(x => Number(x));

function main () {
	let T = rn();
	while (T--) {
		const [n, m] = rna();
		const a = rna();
		const b = rna();
		const c = rna();

		const need = Array(n+1).fill([]);
		let done = n;
		for (let i = 0; i < n; i++) {
			if (a[i] != b[i]) {
				need[b[i]].push(i+1);
				done--;
			}
		}

		let splplk;
		if (need[c[m-1]].length) {
			splplk = need[c[m-1]][0];
		} else {
			for (let i = 0; i < n; i++) {
				if (b[i] == c[m-1]) {
					splplk = i+1;
					break;
				}
			}
			if (!splplk) {
				console.log('NO');
				continue;
			}
		}

		const ans = Array(n+1);
		for (let i = 0; i < m; i++) {
			if (need[c[i]].length) {
				ans[i] = need[c[i]].pop();
				done++;
			} else {
				ans[i] = splplk;
			}
		}

		console.log(done == n ? 'YES\n' + ans.join(' ') : 'NO');
	}
}


var tests = parseInt(readline());
    var n;
    var a, b;
    for (var t=0; t < tests; t++) {
        n = parseInt(readline());
        a = readline().split(' ').map(x=>parseInt(x));
        b = readline().split(' ').map(x=>parseInt(x));

        var minDiff = 0;
        var ans = 'YES';
        var diffMatch = -1;
        for (var i = 0; i < n; i++) {
            var diff = a[i] - b[i];
            if (b[i] == 0) {
                if (diff > minDiff) {
                    minDiff = diff;
                }
            } else {
                if (diff < 0) {
                    ans = 'NO';
                    break;
                } else if (diffMatch == -1){
                    diffMatch = diff;
                } else if (diff != diffMatch) {
                    ans = 'NO';
                    break;
                }
            }
        }
        if (diffMatch != -1 && diffMatch < minDiff) {
            ans = 'NO';
        }

        print(ans);
    }

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function output(x) {
    if (typeof x !== 'string') {
        x = x.toString();
    }
    //process.stdout.write(x);   // without auto '\n' (newline)
    console.log(x);  // with auto '\n' (newline)
}

function main() {
    let N = readline();

    for (let test = 0; test < N; test++) {
        let n = parseInt(readline(), 10);
        let A = readline().split(' ').map(Number);
        let B = readline().split(' ').map(Number);

        let maxDiff = 0;

        for (let i = 0; i < n; i++) {
            let diff = Math.abs(A[i] - B[i]);
            if (diff > maxDiff) {
                maxDiff = diff;
            }
        }

        let ok = true;

        for (let i = 0; i < n; i++) {
            if (B[i] !== 0 && A[i] - B[i] !== maxDiff) {
                ok = false;
                break;
            }
        }

        output(ok ? 'YES' : 'NO');
    }
}

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = []; var outputList = [];var retcode = new Set();
read.on('line', function(input){
	var tmp = input.split(' ');
	for(var i = 0; i < tmp.length; i++){
		inLine.push(tmp[i]);
		if(i == tmp.length - 1){
			retcode.add(inLine.length);
		}
	}
});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
	console.log(myconv(outputList, 9));
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextArray(size, code){
	var ret = new Array(size);
	for(var i = 0; i < size; i++){
		if(code == 'int'){
			ret[i] = nextInt();
		}else if(code == 'long'){
			ret[i] = nextLong();
		}else if(code == 'double'){
			ret[i] = nextDouble();
		}else{
			ret[i] = next();
		}
	}
	return ret;
}
function nextIntArray(size){return nextArray(size, 'int');} function nextStrArray(size){return nextArray(size, 'str');} function nextLongArray(size){return nextArray(size, 'long');} function nextDoubleArray(size){return nextArray(size, 'double');}
function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();} function nextInt(){return myconv(next(),1);} function nextLong(){return BigInt(next());} function nextDouble(){return parseFloat(next());}
function getCountMap(list){
	var map = {};
	for(var i = 0; i < list.length; i++){
		if(map[list[i]] == null){
			map[list[i]] = 0;
		}
		map[list[i]]++;
	}
	return map;
}
function init(input){
	return {
		list : input, index : 0, max : input.length,
		hasNext : function(){return (this.index < this.max);},
		next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}},
		isReturn : function(){return retcode.has(this.index);}
	};
}
function myout(s){outputList.push(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
function isReturn(){return obj.isReturn();}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
	var t = nextInt();
	while(hasNext()){
		var N = nextInt();
		var alist = nextIntArray(N);
		var blist = nextIntArray(N);
		var ok = true;
		var just = -1;
		var must = -1;
		for(var i = 0; i < N; i++){
			if(alist[i] < blist[i]){
				ok = false;
				break;
			}else if(alist[i] >= 0){
				if(blist[i] == 0){
					must = Math.max(must, alist[i]);
				}else{
					if(just == -1){
						just = alist[i] - blist[i];
					}else if(just != alist[i] - blist[i]){
						ok = false;
						break;
					}
				}
			}
		}
		//myerr({just, must});
		if(just != -1){
			if(just < must){
				ok = false;
			}
		}
		if(ok){
			myout("YES");
		}else{
			myout("NO");
		}
	}
}

let stop = '';
process.stdin.on('data', c => stop += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = stop.split(EOL);
    var t = lines[0];
    var n = 0;
    var a = 0;
    for(i = 1; i <= t * 3; i++){
        if(i % 3 == 1){
            n = lines[i];
        }else if(i % 3 == 2){
            a = lines[i].split(' ').map(Number);
        }else{
            var b = lines[i].split(' ').map(Number);
            var T = 0, k = 0;
            for(j = 0; j < n; j++){
                if(a[j] - b[j] < 0){
                    k++;
                    break;
                }
                T = Math.max(T, a[j] - b[j]);
            }
            for(j = 0; j < n; j++){
                if(a[j] - b[j] < T && b[j] !== 0){
                    k++;
                    break;
                }
            }
            console.log(k !== 0 ? 'NO' : 'YES');

        }
    }
});

const rdline = require('readline');
const rl = rdline.createInterface({
    input: process.stdin
});

let lines = [];
rl.on('line', (line) => {
    lines.push(line);
}).on('close', () => {
    // input in lines
    solve();
});

let line = 0;
const readline = () => lines[line++];
/**
 * План подзадачи:
 *  преобразую строки в массивы
 * создам пустой массив C
 * идем по элементам массивов
 *   если элемент массива A меньше  элемента массива B, то сразу выводим невозможность получения массива NO
 *   пока массив A не будет равен массиву B, из каждого элемента массива A вычитай 1
 *
 */
solve = () => {
    const t = parseInt(readline());
    for (let i = 0; i < t; i++) {
        var n = parseInt(readline());
        var a = readline().split(" ").map(Number);
        var b = readline().split(" ").map(Number);
        var dif = 0;
        var ans = "YES";
        if (a === b) {
            ans;
        } else {
            for (let j = 0; j < n; j++) {
                if (a[j] - b[j] > dif) {
                    dif = a[j] - b[j];
                }
            }

            for (let j = 0; j < n; j++) {
                if (a[j] < b[j]) {
                    ans = "NO";
                } else if (a[j] - b[j] !== dif && b[j] !== 0) {
                    ans = "NO";
                }
            }
        }
        console.log(ans)
    }
}

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}

const solve = () => {
  const gcd = (a, b) => (a % b === 0 ? b : gcd(b, a % b));
  let t = parseInt(readline());
  while (t--) {
       let n = parseInt(readline());
       let arr1 = readline().trim().split(" ").map(cur=>parseInt(cur));
       let arr2 = readline().trim().split(" ").map(cur=>parseInt(cur));
       let dif  = Infinity;
       let flag = true;
       for(let i=0;i<n;i++){
            if(arr2[i]===0) continue;
            else{
                 if(arr1[i]<arr2[i]){
                      flag = false;
                      break;
                 }
                 if(dif===Infinity) dif = arr1[i] - arr2[i];
                 else {
                     if(dif!==arr1[i] - arr2[i]){
                          flag = false;
                          break;
                     }
                 }

            }
       }
       if(flag){
            for(let i=0;i<n;i++){
                 if(arr2[i]===0){
                      if(arr1[i]-arr2[i]>dif) {
                           flag = false;
                           break;
                      }
                 }
            }
       }
       if(flag===false) console.log("NO");
       else console.log("YES");
  }
};
solve();

'use strict';

function solve(n, a, b) {
  let max = 0;
  for (let i = 0; i < n; i++) {
    if (a[i] < b[i]) return 'NO';
    max = Math.max(max, a[i] - b[i]);
  }
  const nums = [];
  for (let i = 0; i < n; i++) {
    nums[i] = Math.max(a[i] - max, 0);
  }
  for (let i = 0; i < n; i++) {
    if (b[i] !== nums[i]) return 'NO';
  }
  return 'YES';
}

async function main(read) {
  try {
    let res = [];
    let t = Number(await read());
    while (t--) {
      const n = Number(await read());
      const a = (await read()).split(' ').map(Number);
      const b = (await read()).split(' ').map(Number);
      res.push(solve(n, a, b));
    }
    console.log(res.join('\n'));
  } catch (error) {
    console.log(error);
  }
}

let inputs,
    str = '';
function read() {
  return inputs.next().value.trim();
}
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', input => str += input);
process.stdin.on('end', () => {
  inputs = str.split('\n').values();
  main(read);
});

const readline = require('readline')

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})
const lines = []
rl.on('line', (input) => {
    lines.push(input);
})
rl.on('close', () => {
// (function() {
    // const lines = require('fs').readFileSync('test.in', 'utf8').split('\n')
    let l = 0;
    let t = +lines[l++]
    const output = []
    for (let i = 0; i < t; i++) {
        const n = +lines[l++]
        const sa = lines[l++].trim().split(' ').map(Number)
        const sb = lines[l++].trim().split(' ').map(Number)
        output[i] = solve(n, sa, sb) ? 'YES' : 'NO'
    }
    console.log(output.join('\n'))
// })()
})

function solve(n, sa, sb) {
    const ds = []
    let max = -Infinity
    for (let i = 0; i < n; i++) {
        ds[i] = sa[i] - sb[i]
        max = Math.max(max, ds[i])
    }
    for (let i = 0; i < n; i++) {
        if (ds[i] === max || !sb[i]) {
            //
        } else {
            return false
        }
    }
    return max >= 0
}

T = readline()
while (T--) {
   n = readline()
   a = readline().split(' ').map(a => +a)
   b = readline().split(' ').map(b => +b)
   ans = 'YES'
   xx = 0

   if(JSON.stringify(a)==JSON.stringify(b)){
      print(ans)
   }

   else {
      for(i=0; i<n; i++){
         if((a[i] - b[i]) > xx)
            xx = a[i] - b[i]
      }
      for(i = 0; i<n; i++){
         if(a[i] < b[i])
            ans = 'NO'
         else if((a[i]-b[i] != xx) && (b[i] !=0))
            ans = 'NO'

      }
      print(ans)
   }
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function output(x) {
    if (typeof x !== 'string') {
        x = x.toString();
    }
    //process.stdout.write(x);   // without auto '\n' (newline)
    console.log(x);  // with auto '\n' (newline)
}

function main() {
    let N = readline();

    for (let test = 0; test < N; test++) {
        let n = parseInt(readline(), 10);
        let A = readline().split(' ').map(Number);
        let B = readline().split(' ').map(Number);

        let ok = true;

        for (let i = 0; i < n; i++) {
            if (A[i] < B[i]) {
                ok = false;
                break;
            }
        }

        output(ok ? 'YES' : 'NO');
    }
}

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = []; var outputList = [];var retcode = new Set();
read.on('line', function(input){
	var tmp = input.split(' ');
	for(var i = 0; i < tmp.length; i++){
		inLine.push(tmp[i]);
		if(i == tmp.length - 1){
			retcode.add(inLine.length);
		}
	}
});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
	console.log(myconv(outputList, 9));
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextArray(size, code){
	var ret = new Array(size);
	for(var i = 0; i < size; i++){
		if(code == 'int'){
			ret[i] = nextInt();
		}else if(code == 'long'){
			ret[i] = nextLong();
		}else if(code == 'double'){
			ret[i] = nextDouble();
		}else{
			ret[i] = next();
		}
	}
	return ret;
}
function nextIntArray(size){return nextArray(size, 'int');} function nextStrArray(size){return nextArray(size, 'str');} function nextLongArray(size){return nextArray(size, 'long');} function nextDoubleArray(size){return nextArray(size, 'double');}
function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();} function nextInt(){return myconv(next(),1);} function nextLong(){return BigInt(next());} function nextDouble(){return parseFloat(next());}
function getCountMap(list){
	var map = {};
	for(var i = 0; i < list.length; i++){
		if(map[list[i]] == null){
			map[list[i]] = 0;
		}
		map[list[i]]++;
	}
	return map;
}
function init(input){
	return {
		list : input, index : 0, max : input.length,
		hasNext : function(){return (this.index < this.max);},
		next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}},
		isReturn : function(){return retcode.has(this.index);}
	};
}
function myout(s){outputList.push(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
function isReturn(){return obj.isReturn();}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
	var t = nextInt();
	while(hasNext()){
		var N = nextInt();
		var alist = nextIntArray(N);
		var blist = nextIntArray(N);
		var ok = true;
		var just = -1;
		var must = -1;
		for(var i = 0; i < N; i++){
			if(alist[i] < blist[i]){
				ok = false;
				break;
			}else if(alist[i] > 0){
				if(blist[i] == 0){
					must = Math.max(must, alist[i]);
				}else{
					if(just == -1){
						just = alist[i] - blist[i];
					}else if(just != alist[i] - blist[i]){
						ok = false;
						break;
					}
				}
			}
		}
		if(just != -1){
			if(just < must){
				ok - false;
			}
		}
		if(ok){
			myout("YES");
		}else{
			myout("NO");
		}
	}
}

T = readline()
while (T--) {
   n = readline()
   a = readline().split(' ').map(a => +a)
   b = readline().split(' ').map(b => +b)
   ans = 'NO'
   maxNum = Math.max.apply(null, a)
   while(maxNum--){
      for(i=0; i<n; i++){
         a[i]--
         if(a[i]< 0)
            a[i] =0
      }
      if(JSON.stringify(a)==JSON.stringify(b)){
         ans = 'YES'
         break
      }
   }
   print(ans)
}


let inputString = "";
let currentLine = 0;
process.stdin.on("data", (data) => {
  inputString += data;
});
process.stdin.on("end", function () {
  inputString = inputString
    .trim()
    .split("\n")
    .map((str) => str.trim());
  main();
});
function readLine() {
  return inputString[currentLine++];
}
function main() {
  let t = +readLine();
  while (t--) {
    const len = +readLine();
    const arr = readLine()
      .split(" ")
      .map((n) => parseInt(n));
    let found = false;
    for (let i = 0; i <= len - 3; i++) {
      let [a, b, c] = [arr[i], arr[i + 1], arr[i + 2]];
      if (a < b && b > c) {
        console.log("YES");
        console.log(`${i + 1} ${i + 2} ${i + 3}`);
        found = true;
        break;
      }
    }
    !found && console.log("NO");
  }
}

// node template.js < A-small.in > A-small.out

function main() {
    var tests = 1;
    tests = nextInt();

    for (let t = 1; t <= tests; t++) {
        let N = nextInt();
        let a = [];
        for(let i = 0; i < N; i++) {
            a.push(nextInt());
        }

        let result = "NO";

        for(let i = 0; i+2 < a.length; i++) {
            if (a[i] < a[i+1] && a[i+1] > a[i+2]) {
                result = "YES\n" + (i+1) + " " + (i+2) + " " + (i+3);
                break;
            }
        }

        print(result);
    }
}

// ------- Template ------------------
function newTensor(dimensions, value) {
    let res = [];
    let dim = dimensions[0], subdim = dimensions.slice(1);
    if (subdim.length == 0) {
        for(let i = 0; i < dim; i++) {
            res.push(value);
        }
    } else {
        for(let i = 0; i < dim; i++) {
            res.push(newTensor(subdim, value));
        }
    }
    return res;
}

if (!String.prototype.startsWith) {
    Object.defineProperty(String.prototype, 'startsWith', {
        value: function(search, rawPos) {
            var pos = rawPos > 0 ? rawPos|0 : 0;
            return this.substring(pos, pos + search.length) === search;
        }
    });
}
if (!String.prototype.endsWith) {
    String.prototype.endsWith = function(search, this_len) {
        if (this_len === undefined || this_len > this.length) {
            this_len = this.length;
        }
        return this.substring(this_len - search.length, this_len) === search;
    };
}

var curTokens = [], curToken = 0;

function next() {
    while (curToken >= curTokens.length) {
        curTokens = readline().split(/[\s]+/);
        curToken = 0;
    }
    return curTokens[curToken++];
}

function nextInt() {
    return parseInt(next());
}

// code for nodejs
var inputBuffer = '', curLine = 0;

function readline() {
    return inputBuffer[curLine++];
}

function print(data) {
    process.stdout.write(data + '\n');
}

process.stdin.resume();
process.stdin.setEncoding('utf8');

process.stdin.on('data', function (chunk) {
    inputBuffer += chunk;
});

process.stdin.on('end', function () {
    inputBuffer = inputBuffer.split(/[\s]+/);
    main();
});

var n = parseInt(readline());
var res = [];

while (n--){
    readline();//ODIO LE DONNE
    var inn = readline().split(" ").map(function (a) {
        return parseInt(a);
    });
    var f = false;
    for (var i = 1 ; i<inn.length -1;i++){
        if (inn[i] > inn[i - 1] && inn[i] > inn[i + 1]) {
            f=true;
            res.push([i,i+1,i+2]);
            break;
        }
    }
    if (!f){
        res.push([])
    }

}
for (var i = 0;i<res.length;i++){
    write((res[i].length === 0)?"NO\n":("YES\n"+res[i].join(" ")+"\n"));

}

function solve() {
   var n = Number(read());
   var a = readArray(Number);
   for (var i = 1; i < n; i++) {
      if (a[i - 1] < a[i] && a[i + 1] < a[i]) {
         write('YES');
         write(i + ' ' + (i + 1) + ' ' + (i + 2));
         return;
      }
   }
   write('NO');
}

function init() {
   var T;
   T = 1;
   T = Number(read());
   for (var t = 0; t < T; t++) {
      solve();
   }
}

function readArray(mapF) {
   return read().split(' ').map(mapF);
}

function sortF(a, b) {
   if (a < b) {
      return -1;
   }
   if (a > b) {
      return 1;
   }
   return 0;
}

var isNode = typeof console !== 'undefined';
var MEMORY = [];
var MEMORY_INDEX = 0;
if (isNode) {
   var fs = require('fs');
   var path = require('path');

   var inTextName;
   var outTextName;
   if (process.argv.length === 5) {
      inTextName = process.argv[3];
      outTextName = process.argv[4];
   }

   if (inTextName) {
      fs.readFile(path.join(__dirname, inTextName), 'utf8', (err, data) => {
         MEMORY = data.split('\r\n');
         init();
      });
   } else {
      var RL = require('readline').createInterface({
         input : process.stdin,
         output : process.stdout
      });

      RL.on('line', (line) => {
         MEMORY.push(line);
      });

      RL.on('close', init);
   }
} else {
   init();
}

function write(value) {
   isNode ? console.log(value) : print(value);
}
function read() {
   return isNode ? MEMORY[MEMORY_INDEX++] : readline();
}

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let c = 0;

rl.on('line', (d) => {
  if (c === 0) {
    c++;
    return;
  }

  if (c % 2) {
    c++;
    return;
  }

  const arr = d.split(' ').map(Number);
  let ans = 'NO';
  const arrIdx = [];

  for (let i = 1; i < arr.length - 1; i++) {
    if (arr[i] > arr[i - 1] && arr[i] > arr[i + 1]) {
      ans = 'YES';
      arrIdx.push(i, i + 1, i + 2);
      break;
    }
  }

  console.log(ans);

  if (arrIdx.length) {
    console.log(arrIdx.join(' '));
  }

  c++;
});

var n = parseInt(readline());
var res = [];

while (n--){
    readline();//ODIO LE DONNE
    var inn = readline().split(" ").map(function (a) {
        return parseInt(a);
    });
    var f = false;
    for (var i = 1 ; i<inn.length -1;i++){
        if (inn[i-1] < inn[i] && inn[i]>inn[i+1]){
            f=true;
            res.push([i-1,i,i+1]);
            break;
        }
    }
    if (!f){
        res.push([])
    }

}
for (var i = 0;i<res.length;i++){
    write((res[i].length === 0)?"NO\n":("YES\n"+res[i].join(" ")+"\n"));

}

var n = parseInt(readline());
var res = [];

while (n--){
    readline();//ODIO LE DONNE
    var inn = readline().split(" ").map(function (a) {
        return parseInt(a);
    });
    var f = false;
    loop1:for (var i = 0 ; i<inn.length -2;i++){
        for (var j = i+1 ; j<inn.length -1;j++){
            if (inn[i]>inn[j]){
                continue;
            }
            for (var k = j+1 ; k<inn.length;k++){
                if (inn[j]>inn[k]){
                    res.push([i+1,j+1,k+1]);
                    f = true;
                    break loop1;
                }
            }
        }
    }
    if (!f){
        res.push([])
    }

}
for (var i = 0;i<res.length;i++){
    write((res[i].length === 0)?"NO\n":("YES\n"+res.join(" ")+"\n"));

}