Chef has 2 strings A and B of equal length N. Both strings contain lowercase english alphabets only.

Chef can perform several moves on string A. In one move, Chef has to:
Select an index i \space (1 ≤ i ≤ N-1).
Replace A[i] with (A[i]+1).
Replace A[i+1] with (A[i+1]+1).

For example, if A = \texttt{abcze}, a valid move would be to select index 3. This way the string becomes \texttt{abdae} after performing the move. Note that the value at an index is cyclically incremented. This means that, \texttt{a} \rightarrow \texttt{b}, \texttt{b} \rightarrow \texttt{c}, \ldots, \texttt{z} \rightarrow \texttt{a}.

Chef has been asked to answer Q queries. Each query is of the form:
L R: Given 1 ≤ L ≤ R ≤ N, Chef wants to know if it is possible to convert the substring A[L, R] to B[L, R] by performing the above mentioned move any number of times.

For each query, output in a single line \texttt{Yes}, if the conversion is possible using any number of moves. Otherwise, print \texttt{No}.

NOTE: Queries are independent. Thus, the original strings A and B would be retained to process next query. For each query solve for substrings A[L,R] and B[L,R] only. So valid values for i will be among L to R - 1 only. 

------ Input Format ------ 

- The first line will contain T - the number of test cases. Then the test cases follow.
- First line of each test case contains two integers N, Q. 
- Second line of each test case contains string A. 
- Third line of each test case contains string B. 
- Q lines follow, where the i^{th} line contains two integers L_{i} R_{i} - the i^{th} query.  

------ Output Format ------ 

Output Q lines, where the i^{th} line contains the answer to the i^{th} query. The answer is \texttt{Yes}, if the conversion is possible using any number of moves. Otherwise, the answer is \texttt{No}.

You may print each character of the string in uppercase or lowercase (for example, the strings \texttt{yEs}, \texttt{yes}, \texttt{Yes} and \texttt{YES} will all be treated as identical).

------ Constraints ------ 

$1 ≤ T ≤ 1000$
$2 ≤ N ≤ 10^{5}$
$1 ≤ Q ≤ 2\cdot 10^{5}$
$1 ≤ L ≤R ≤N$
- Sum of $N$ over all test cases does not exceed $2 \cdot 10^{5}$.
- Sum of $Q$ over all test cases does not exceed $2 \cdot 10^{5}$.

----- Sample Input 1 ------ 
1
5 3
abcdz
nbhea
2 2
1 3
4 5

----- Sample Output 1 ------ 
Yes
No
Yes

----- explanation 1 ------ 
Test Case $1$: 
- For the first query, the substring $A[2,2] = \texttt{b}$ is already same as $B[2,2] = \texttt{b}$. Thus, the answer is $\texttt{Yes}$.
- For the second query, it can be proven that the substring $A[1,3]$ can never be made equal to $B[1,3]$ using any number of moves.
- For the third query, the substring $A[4,5] = \texttt{dz}$ and $B[4,5] = \texttt{ea}$. Applying the move on index $4$, we get $A[4] = \texttt{e}$ and $A[5] = \texttt{a}$. Hence, after one move, $A[4,5] = B[4,5]$. Thus, the answer is $\texttt{Yes}$ in this case.

Source: codechef | Difficulty: HARD


Solutions:
t = int(input())
for _ in range(t):
	(n, q) = map(int, input().split())
	a = list(input())
	b = list(input())
	alt_sum = [0] * n
	for i in range(n):
		k = (ord(b[i]) - ord(a[i])) % 26
		if i == 0:
			alt_sum[i] = k
			continue
		if i % 2 == 0:
			alt_sum[i] = k + alt_sum[i - 1]
		else:
			alt_sum[i] = -k + alt_sum[i - 1]
	for i in range(q):
		(l, r) = map(int, input().split())
		l -= 1
		r -= 1
		if l == 0 and alt_sum[r] % 26 == 0 or (l != 0 and (alt_sum[r] - alt_sum[l - 1]) % 26 == 0):
			print('Yes')
		else:
			print('No')


d = {'a': 97, 'b': 98, 'c': 99, 'd': 100, 'e': 101, 'f': 102, 'g': 103, 'h': 104, 'i': 105, 'j': 106, 'k': 107, 'l': 108, 'm': 109, 'n': 110, 'o': 111, 'p': 112, 'q': 113, 'r': 114, 's': 115, 't': 116, 'u': 117, 'v': 118, 'w': 119, 'x': 120, 'y': 121, 'z': 122}
for i in range(int(input())):
	(n, q) = map(int, input().split())
	a = input()
	b = input()
	arr = [0]
	sum = 0
	for i in range(n):
		if d[a[i]] <= d[b[i]]:
			val = d[b[i]] - d[a[i]]
		else:
			val = 26 + d[b[i]] - d[a[i]]
		if i % 2 == 0:
			sum += val
			arr.append((sum + 26) % 26)
		else:
			sum -= val
			arr.append((sum + 26) % 26)
	for i in range(q):
		(l, r) = map(int, input().split())
		if arr[l - 1] == arr[r]:
			print('Yes')
		else:
			print('No')


for u in range(int(input())):
	(n, q) = map(int, input().split())
	a = input()
	b = input()
	x = []
	for i in range(n):
		temp = ord(a[i]) - ord(b[i])
		if temp <= 0:
			x.append(abs(temp))
		else:
			x.append(26 - temp)
	p = [0]
	for i in range(1, n + 1):
		if i % 2:
			p.append(p[i - 1] - x[i - 1])
		else:
			p.append(p[i - 1] + x[i - 1])
	for w in range(q):
		(l, r) = map(int, input().split())
		if (p[r] - p[l - 1]) % 26 == 0:
			print('Yes')
		else:
			print('No')


for _ in range(int(input())):
	(n, q) = map(int, input().split())
	a1 = [ord(i) - 97 for i in input()]
	b1 = [ord(i) - 97 for i in input()]
	prefix_sum = [0]
	for i in range(n):
		diff = (a1[i] - b1[i]) % 26
		if i % 2 == 0:
			prefix_sum.append((prefix_sum[i] + diff) % 26)
		else:
			prefix_sum.append((prefix_sum[i] - diff) % 26)
	for i in range(q):
		(l, r) = map(int, input().split())
		if (prefix_sum[r] - prefix_sum[l - 1]) % 26 == 0:
			print('Yes')
		else:
			print('No')


t = int(input())
result = []
for z in range(t):
	(n, q) = map(int, input().split())
	a = input()
	b = input()
	dif = [0]
	for i in range(n):
		if i % 2 == 0:
			dif.append(dif[-1] + (ord(a[i]) - ord(b[i])))
		else:
			dif.append(dif[-1] - (ord(a[i]) - ord(b[i])))
	for x in range(q):
		(l, r) = map(int, input().split())
		if (dif[r] - dif[l - 1]) % 26 == 0:
			result.append('Yes')
		else:
			result.append('No')
for k in result:
	print(k)


from sys import stdin
input = stdin.readline
t = int(input())
for _ in range(t):
	(n, q) = map(int, input().split())
	a = input().strip()
	b = input().strip()
	pre_a = [ord(a[0])]
	pre_b = [ord(b[0])]
	for i in range(1, n):
		if i % 2 == 1:
			pre_a.append(pre_a[i - 1] - ord(a[i]))
			pre_b.append(pre_b[i - 1] - ord(b[i]))
		else:
			pre_a.append(pre_a[i - 1] + ord(a[i]))
			pre_b.append(pre_b[i - 1] + ord(b[i]))
	for i in range(q):
		(l, r) = map(int, input().split())
		l -= 1
		r -= 1
		sa = 0
		sb = 0
		if l == 0:
			sa = pre_a[r]
			sb = pre_b[r]
		else:
			sa = pre_a[r] - pre_a[l - 1]
			sb = pre_b[r] - pre_b[l - 1]
		if l % 2 == 0:
			sa = -sa
		else:
			sb = -sb
		if ((sb + sa) / 26).is_integer():
			print('Yes')
		else:
			print('No')


T = int(input())
for _ in range(T):
	(N, Q) = list(map(int, input().split()))
	A = [ord(c) - 97 for c in input()]
	B = [ord(c) - 97 for c in input()]
	prefix_sums = [0]
	alt_sum = 0
	for i in range(N):
		diff = B[i] - A[i]
		if i % 2 == 0:
			alt_sum = (alt_sum + diff) % 26
		else:
			alt_sum = (alt_sum - diff) % 26
		prefix_sums.append(alt_sum)
	for i in range(Q):
		(L, R) = list(map(int, input().split()))
		if (prefix_sums[R] - prefix_sums[L - 1]) % 26 == 0:
			print('Yes')
		else:
			print('No')


test = int(input())
for case in range(test):
	(n, q) = map(int, input().split())
	a = input()
	b = input()
	orr = [0] * n
	for o in range(n):
		if a[o] < b[0]:
			orr[o] = (ord(b[o]) - ord(a[o])) % 26
		else:
			orr[o] = 26 - (ord(a[o]) - ord(b[o]))
	op = [0] * (n + 1)
	for i in range(n):
		if i % 2 == 0:
			x = 1
		else:
			x = -1
		op[i + 1] = (op[i] + x * orr[i]) % 26
	for query in range(q):
		(l, r) = map(int, input().split())
		if op[l - 1] == op[r]:
			print('Yes')
		else:
			print('No')


import string
letters = string.ascii_lowercase
for _ in range(int(input())):
	(n, q) = map(int, input().split())
	a = input()
	b = input()
	prefix_sum = [0] * (n + 1)
	for i in range(n):
		if i % 2 == 0:
			prefix_sum[i + 1] += prefix_sum[i] + (letters.find(b[i]) - letters.find(a[i])) % 26
		else:
			prefix_sum[i + 1] = prefix_sum[i] - (letters.find(b[i]) - letters.find(a[i])) % 26
	for _ in range(q):
		(x, y) = map(int, input().split())
		if prefix_sum[x - 1] % 26 == prefix_sum[y] % 26:
			print('Yes')
		else:
			print('No')


for _ in range(int(input())):
	(n, z) = map(int, input().split())
	ak = list(input())
	b = list(input())
	a = [0]
	for i in range(n):
		if i % 2 == 0:
			a.append(a[-1] + ord(ak[i]) - ord(b[i]))
		else:
			a.append(a[-1] - ord(ak[i]) + ord(b[i]))
	for i in range(z):
		(l, r) = map(int, input().split())
		count = a[r] - a[l - 1]
		if count % 26 == 0:
			print('Yes')
		else:
			print('No')


t = int(input())
for i in range(0, t):
	(n, x) = map(int, input().split())
	ak = list(input())
	b = list(input())
	a = [0]
	for j in range(0, n):
		if j % 2 == 0:
			a.append(a[-1] + ord(ak[j]) - ord(b[j]))
		else:
			a.append(a[-1] - ord(ak[j]) + ord(b[j]))
	for j in range(0, x):
		(l, r) = map(int, input().split())
		count = a[r] - a[l - 1]
		if count % 26 == 0:
			print('Yes')
		else:
			print('No')


def SieveOfEratosthenes(n):
	primes = [i for i in range(n + 3)]
	n += 2
	primes[1] = 1
	for i in range(4, n, 2):
		primes[i] = 2
	for i in range(3, ceil(sqrt(n)) + 1):
		if primes[i] == i:
			for j in range(i * i, n, i):
				if primes[j] == j:
					primes[j] = i
	return primes

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % mod
		den = den * (i + 1) % mod
	return num * pow(den, mod - 2, mod) % mod

def primeFactors(n, primes):
	res = []
	while n != 1:
		factor = primes[n]
		res.append(factor)
		n //= factor
	return res
import sys
import math
import bisect
import os
import heapq
from functools import cmp_to_key
from sys import stdin, stdout
from io import BytesIO, IOBase
from math import gcd, floor, sqrt, log, inf
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from collections import Counter
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
input = lambda : sys.stdin.readline().rstrip('\r\n')
inp = lambda : int(input())
strng = lambda : input().strip()
jn = lambda x, l: x.join(map(str, l))
strl = lambda : list(input().strip())
mul = lambda : map(int, input().strip().split())
mulf = lambda : map(float, input().strip().split())
seq = lambda : list(map(int, input().strip().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdpr = lambda x: stdout.write(str(x))
mod = 1000000007

def solver():
	(n, q) = mul()
	a = input()
	b = input()
	c = [0] * n
	d = [0]
	for i in range(n):
		c[i] = (ord(b[i]) - ord(a[i]) + 26) % 26
		if i & 1 == 0:
			d.append(d[-1] + c[i])
		else:
			d.append(d[-1] - c[i])
	for _ in range(q):
		(l, r) = mul()
		if (d[r] - d[l - 1]) % 26 == 0:
			print('Yes')
		else:
			print('No')
tt = 1
tt = inp()
for _ in range(tt):
	solver()


nmbr = lambda : int(input())
lst = lambda : list(map(int, input().split()))
for _ in range(nmbr()):
	(n, q) = lst()
	s1 = input()
	s2 = input()
	diff = []
	for (src, des) in zip(s1, s2):
		diff.append((ord(des) - ord(src) + 26) % 26)
	even = [0] * n
	odd = [0] * n
	for i in range(n):
		if i > 0:
			even[i] += even[i - 1]
			odd[i] += odd[i - 1]
		if i & 1:
			odd[i] += diff[i]
		else:
			even[i] += diff[i]
	for _ in range(q):
		(l, r) = lst()
		l -= 1
		r -= 1
		smo = odd[r] - (odd[l - 1] if l >= 1 else 0)
		sme = even[r] - (even[l - 1] if l >= 1 else 0)
		if r & 1:
			sm = (smo - sme) % 26
		else:
			sm = (sme - smo) % 26
		if sm == 0:
			print('Yes')
		else:
			print('No')


def solve(lis, l, r):
	odd = even = 0
	n = r - l + 1
	i = 0
	while i < n:
		even += lis[i]
		i += 1
		if i < n:
			odd += lis[i]
		i += 1
	if odd == even:
		return 'Yes'
	return 'No'
t = int(input())
for _ in range(t):
	(n, q) = map(int, input().split())
	a = input()
	b = input()
	diff = [0] * n
	for i in range(n):
		if a[i] <= b[i]:
			diff[i] = ord(b[i]) - ord(a[i])
		else:
			diff[i] = ord('z') - ord(a[i]) + ord(b[i]) - 96
	j = 2
	while j < n:
		diff[j] += diff[j - 2]
		j += 1
	lis = []
	for _ in range(q):
		(l, r) = map(int, input().split())
		lis.append([l, r])
	for val in lis:
		(l, r) = (val[0], val[1])
		if l == r:
			if a[l - 1] == b[l - 1]:
				print('Yes')
			else:
				print('No')
		else:
			l -= 1
			r -= 1
			frst = scnd = 0
			if (r - l + 1) % 2 == 1:
				frst = diff[r]
				if l - 2 >= 0:
					frst -= diff[l - 2]
				scnd = 0
				if r - 1 >= 0:
					scnd = diff[r - 1]
				l += 1
				if l - 2 >= 0:
					scnd -= diff[l - 2]
			else:
				frst = diff[r]
				scnd = 0
				if r - 1 >= 0:
					scnd = diff[r - 1]
				if l - 2 >= 0:
					scnd -= diff[l - 2]
				l += 1
				if l - 2 >= 0:
					frst -= diff[l - 2]
			if abs(frst - scnd) % 26 == 0:
				print('Yes')
			else:
				print('No')


for _ in range(int(input())):
	(n, q) = map(int, input().split())
	a = input()
	b = input()
	d = [ord(a[i]) - ord(b[i]) for i in range(n)]
	diff = [0, d[0]] + [0 for _ in range(n - 1)]
	for i in range(1, n + 1):
		if i % 2:
			diff[i] = diff[i - 1] - d[i - 1]
		else:
			diff[i] = diff[i - 1] + d[i - 1]
	for t in range(q):
		(l, r) = map(int, input().split())
		s = abs(diff[r] - diff[l - 1])
		if s % 26 == 0:
			print('Yes')
		else:
			print('No')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = input().strip('\n')
	b = input().strip('\n')
	pre = [0 for i in range(n + 1)]
	for i in range(1, n + 1):
		diff = ord(b[i - 1]) - ord(a[i - 1])
		if diff < 0:
			diff += 26
		if i % 2 == 1:
			pre[i] = pre[i - 1] + diff
		else:
			pre[i] = pre[i - 1] - diff
		pre[i] = (pre[i] + 26) % 26
	for i in range(m):
		(l, r) = map(int, input().split())
		if pre[l - 1] == pre[r]:
			print('Yes')
		else:
			print('No')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = input()
	b = input()
	ans = []
	for i in range(n):
		if b[i] >= a[i]:
			ans.append(ord(b[i]) - ord(a[i]))
		else:
			ans.append(26 - (ord(a[i]) - ord(b[i])))
	c = [0]
	d = [ans[0]]
	for i in range(1, n):
		if i % 2:
			c.append(c[i - 1] + ans[i])
			d.append(d[i - 1])
		else:
			d.append(d[i - 1] + ans[i])
			c.append(c[i - 1])
	for i in range(m):
		(l, r) = map(int, input().split())
		l -= 1
		r -= 1
		k1 = c[r]
		k2 = d[r]
		if l > 0:
			k1 -= c[l - 1]
			k2 -= d[l - 1]
		if abs(k1 - k2) % 26 == 0:
			print('Yes')
		else:
			print('No')


from collections import Counter
from sys import stdin
from math import ceil
input = stdin.readline
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = input().strip()
	b = input().strip()
	ans = []
	for i in range(n):
		if b[i] >= a[i]:
			ans.append(ord(b[i]) - ord(a[i]))
		else:
			ans.append(26 - (ord(a[i]) - ord(b[i])))
	c = [0]
	d = [ans[0]]
	for i in range(1, n):
		if i % 2:
			c.append(c[i - 1] + ans[i])
			d.append(d[i - 1])
		else:
			d.append(d[i - 1] + ans[i])
			c.append(c[i - 1])
	for i in range(m):
		(l, r) = map(int, input().split())
		l -= 1
		r -= 1
		k1 = c[r]
		k2 = d[r]
		if l > 0:
			k1 -= c[l - 1]
			k2 -= d[l - 1]
		if abs(k1 - k2) % 26 == 0:
			print('Yes')
		else:
			print('No')


for _ in range(int(input())):
	(n, q) = map(int, input().split())
	(s, s1) = (input(), input())
	v = []
	for i in range(n):
		if s[i] < s1[i]:
			v.append(26 - ord(s1[i]) + ord(s[i]))
		else:
			v.append(ord(s[i]) - ord(s1[i]))
	od = [0]
	ev = [v[0]]
	for i in range(1, n):
		if i % 2 == 0:
			od.append(od[i - 1])
			ev.append(ev[i - 1] + v[i])
		else:
			od.append(od[i - 1] + v[i])
			ev.append(ev[i - 1])
	for i in range(q):
		(a, b) = map(int, input().split())
		a -= 1
		b -= 1
		a2 = ev[b]
		a1 = od[b]
		if a > 0:
			a1 -= od[a - 1]
			a2 -= ev[a - 1]
		temp = abs(a1 - a2)
		if temp % 26 != 0:
			print('No')
		else:
			print('Yes')


t = int(input())
for _ in range(t):
	(n, q) = map(int, input().split())
	a = input()
	b = input()
	diff = []
	for i in range(n):
		a1 = ord(a[i])
		b1 = ord(b[i])
		if b1 < a1:
			diff.append(26 + b1 - a1)
		else:
			diff.append(b1 - a1)
	dp1 = [0] * (n // 2 + 1)
	if n % 2 != 0:
		dp1 = [0] * (n // 2 + 2)
	dp2 = [0] * (n // 2 + 1)
	(l1, l2) = (1, 1)
	for i in range(1, n + 1):
		if i % 2 == 1:
			dp1[l1] = diff[i - 1] + dp1[l1 - 1]
			l1 += 1
		else:
			dp2[l2] = diff[i - 1] + dp2[l2 - 1]
			l2 += 1
	for i in range(q):
		(l, r) = map(int, input().split())
		d = r - l + 1
		(q1, q2) = (0, 0)
		if d % 2 == 0:
			if l % 2 == 0:
				q1 = dp2[r // 2] - dp2[l // 2 - 1]
				q2 = dp1[r // 2 + 1] - dp1[l // 2]
			else:
				q1 = dp2[r // 2] - dp2[l // 2]
				q2 = dp1[r // 2] - dp1[l // 2]
		elif l % 2 == 0:
			q1 = dp2[r // 2] - dp2[l // 2 - 1]
			q2 = dp1[r // 2] - dp1[l // 2]
		else:
			q1 = dp2[r // 2] - dp2[l // 2]
			q2 = dp1[r // 2 + 1] - dp1[l // 2]
		print('Yes') if q1 % 26 == q2 % 26 else print('No')


def build(tree, arr, start, end, index):
	if start == end:
		if start % 2 == 0:
			tree[index] = arr[start]
		else:
			tree[index] = (-arr[start] + 26) % 26
		return
	mid = start + (end - start) // 2
	build(tree, arr, start, mid, 2 * index + 1)
	build(tree, arr, mid + 1, end, 2 * index + 2)
	tree[index] = (tree[2 * index + 1] + tree[2 * index + 2] + 26) % 26

def update(tree, index, start, end, pos, val):
	if start == end:
		if start % 2 == 0:
			tree[index] = val
		else:
			tree[index] = -val
		return
	mid = start + (end - start) // 2
	if mid >= pos:
		update(tree, 2 * index + 1, start, mid, pos, val)
	else:
		update(tree, 2 * index + 2, mid + 1, end, pos, val)
	tree[index] = tree[2 * index + 1] + tree[2 * index + 2]

def FindSum(tree, start, end, L, R, index):
	if L > end or R < start:
		return 0
	if L <= start and R >= end:
		return (tree[index] + 26) % 26
	mid = start + (end - start) // 2
	X = (FindSum(tree, start, mid, L, R, 2 * index + 1) + 26) % 26
	Y = (FindSum(tree, mid + 1, end, L, R, 2 * index + 2) + 26) % 26
	return (X + Y) % 26
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = input()
	b = input()
	diff = []
	for (i, j) in zip(a, b):
		diff.append((ord(j) - ord(i) + 26) % 26)
	N = len(diff)
	tree = [0 for i in range(4 * N + 5)]
	build(tree, diff, 0, N - 1, 0)
	for _ in range(m):
		(a, b) = map(int, input().split())
		a -= 1
		b -= 1
		p = FindSum(tree, 0, N - 1, a, b, 0)
		if p == 0:
			print('Yes')
		else:
			print('No')


def solve(n, q, s1, s2):
	dp = [0 for i in range(n)]
	for i in range(n):
		dp[i] = (ord(s1[i]) - ord(s2[i])) % 26
	for i in range(1, n):
		x = dp[i] - dp[i - 1]
		if x < 0:
			x = x * -1
			if x % 26 == 0:
				dp[i] += x
			else:
				te = x // 26
				te += 1
				dp[i] += te * 26
	ev = [0 for i in range(n)]
	od = [0 for i in range(n)]
	for i in range(n):
		if i % 2 == 0:
			if i > 0:
				od[i] += od[i - 1]
			od[i] += dp[i]
			if i < n - 1:
				od[i + 1] = od[i]
		else:
			ev[i] += ev[i - 1]
			ev[i] += dp[i]
			if i < n - 1:
				ev[i + 1] = ev[i]
	for i in range(q):
		(l, r) = map(int, input().split())
		l -= 1
		r -= 1
		if l == r:
			if s1[l] == s2[l]:
				print('Yes')
			else:
				print('No')
		else:
			te = -1
			to = -1
			if l == 0:
				te = ev[r]
				to = od[r]
			else:
				te = ev[r] - ev[l - 1]
				to = od[r] - od[l - 1]
			if (te - to) % 26 == 0:
				print('Yes')
			else:
				print('No')
for _ in range(int(input())):
	(n, q) = map(int, input().split())
	s1 = input()
	s2 = input()
	solve(n, q, s1, s2)


import sys
import bisect
from bisect import bisect_left as lb
from bisect import bisect_right as rb
input_ = lambda : sys.stdin.readline().strip('\r\n')
from math import log
from math import gcd
from math import atan2, acos
from random import randint
sa = lambda : input_()
sb = lambda : int(input_())
sc = lambda : input_().split()
sd = lambda : list(map(int, input_().split()))
sflo = lambda : list(map(float, input_().split()))
se = lambda : float(input_())
sf = lambda : list(input_())
flsh = lambda : sys.stdout.flush()
mod = 10 ** 9 + 7
mod1 = 998244353
gp = []
cost = []
dp = []
mx = []
ans1 = []
ans2 = []
special = []
specnode = []
a = 0
kthpar = []

def dfs2(root, par):
	if par != -1:
		dp[root] = dp[par] + 1
	for i in range(1, 20):
		if kthpar[root][i - 1] != -1:
			kthpar[root][i] = kthpar[kthpar[root][i - 1]][i - 1]
	for child in gp[root]:
		if child == par:
			continue
		kthpar[child][0] = root
		dfs(child, root)
ans = 0
a = []
(n, k) = (0, 0)
b = []
vis = []
tot = 0
time = []
time1 = []
adj = []
mx = -1
eps = 1e-07
gp = []
ans = []

def update_it(bit, i, val):
	n = len(bit)
	while i < n:
		bit[i] += val
		i += i & -i

def get_ans(bit, i):
	n = len(bit)
	tot = 0
	while i > 0:
		tot += bit[i]
		i -= i & -i
	return tot

def flip(a, l, r):
	for i in range(l, r):
		a[i] = '0' if a[i] == '1' else '1'
	return

def hnbhai(tc):
	(n, q) = sd()
	a = '#' + sa()
	b = '#' + sa()
	diff = [0] * (n + 1)
	odd = [0] * (n + 1)
	even = [0] * (n + 1)
	for i in range(1, n + 1):
		odd[i] = odd[i - 1]
		even[i] = even[i - 1]
		diff[i] = (ord(b[i]) - ord(a[i]) + 26) % 26
		if i % 2 == 1:
			odd[i] += diff[i]
		if i % 2 == 0:
			even[i] += diff[i]
	for i in range(q):
		(l, r) = sd()
		e = (even[r] - even[l - 1] + 26) % 26
		o = (odd[r] - odd[l - 1] + 26) % 26
		if e == o:
			print('Yes')
		else:
			print('No')
	return
for _ in range(sb()):
	hnbhai(_ + 1)