Under construction

Still being built. Things may change

Intuitive Elements

Time limit1sMemory limit2048 MB

Summary
Given two lowercase strings, the task checks whether every letter in the abbreviation b also appears somewhere in the name a, printing YES or NO for each test case.
Level

Easy1 of 10

Topics
String, Hash map
Solved
No attempts yet

Problem

Brandon is learning the periodic table! However, he doesn't like some of the elements because the symbol of the element contains letters which are not present in the name of the element. He finds this to be unintuitive, especially because in other contexts, he expects abbreviations to not introduce random letters.

Given a string and a proposed abbreviation, determine if Brandon would find it intuitive. Brandon finds an abbreviation intuitive if and only if every letter that appears in the abbreviation appears in the original string. Brandon does not look at the abbreviation carefully, so it is acceptable for a letter to appear more times in the abbreviation than in the original string, or for the letters to appear in a different order between the string and the abbreviation.

Input

The first line contains a single integer tt (1≤t≤1031\leq t \leq 10^3), the number of test cases. Each test case has two lines. The first line contains a string aa of length at least 2 and at most 50, consisting only of lowercase letters. The second line contains a string bb that is strictly shorter than aa, also consisting only of lowercase letters.

Output

For each test case, output YES if every letter in bb appears in aa, and NO otherwise. Print one answer per line.

Examples1

  1. Example 1

    Input
    4
    magnesium
    mg
    silver
    ag
    aabb
    bbb
    aabb
    ba
    
    Expected output
    YES
    NO
    YES
    YES