#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
int modd = 998244353;
const int MAX = 4e5 + 5;
const int inf = 1e9;
long long bipow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * 1LL * a) % mod;
    a = (a * 1LL * a) % mod;
    b >>= 1;
  }
  return ans;
}
bool isPrime(int x) {
  if (x == 1)
    return 0;
  else if (x == 2 || x == 3)
    return 1;
  if (x % 2 == 0 || x % 3 == 0) return 0;
  for (int i = 5; i * i <= x; i += 6) {
    if (x % i == 0 || x % (i + 2) == 0) return 0;
  }
  return 1;
}
inline long long add(long long x, long long y) {
  return (x % mod + y % mod) % mod;
}
inline long long sub(long long x, long long y) {
  if (x < 0) x += mod;
  if (y < 0) y += mod;
  return (x % mod - y % mod + mod) % mod;
}
inline long long mul(long long x, long long y) {
  return ((x % mod) * (y % mod)) % mod;
}
inline long long dvd(long long x, long long y) {
  return mul(x, bipow(y, mod - 2));
}
bool pld(string &s, int l, int r) {
  while (l < r) {
    if (s[l] != s[r]) return 0;
    l++, r--;
  }
  return 1;
}
void solve(int test) {
  string s, t;
  cin >> s >> t;
  int n = s.length(), m = t.length();
  string s2 = t;
  reverse(s2.begin(), s2.end());
  string tmp = "";
  bool ans = 0;
  if (s.find(t) != -1 || s.find(s2) != -1)
    cout << "YES\n";
  else {
    for (int r = 0; r < m; r += 2) {
      if (pld(t, 0, r)) {
        int mid = (r) / 2;
        string tmp1 = t.substr(r + 1), tmp2 = t.substr(0, mid + 1);
        reverse(tmp1.begin(), tmp1.end());
        string chk = tmp1 + tmp2;
        if (s.find(chk) != -1) ans = 1;
      }
      if (ans) break;
    }
    for (int l = m - 1; l >= 0; l -= 2) {
      int mid = (l + m - 1) / 2;
      if (pld(t, l, m - 1)) {
        string chk = t.substr(0, l) + t.substr(l, mid - l + 1);
        if (s.find(chk) != -1) ans = 1;
      }
      if (ans) break;
    }
    if (ans)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int tc = 1;
  cin >> tc;
  for (int ttc = 1; ttc <= tc; ttc++) {
    solve(ttc);
  }
  return 0;
}
