# Arup Guha
# 4/29/2024
# Solution to COP 4516 Team Final Contest Problem A: Advertising UCF

''' This code is for my bit, no object since I don't really know how to
    do that in python...
'''

# Adds val to index idx in mybit.
def add(mybit,idx,val):
   while idx<len(mybit):
      mybit[idx] += val
      idx += (idx&(-idx))

# Returns sum of items from index 1 to idx in mybit.
def query(mybit,idx):
   res = 0
   while idx>0:
      res += mybit[idx]
      idx -= (idx&(-idx))
   return res

# Returns sum of items from index lo to hi in mybit.
def rangeq(mybit,lo,hi):
   return query(mybit,hi)-query(mybit,lo-1)

# Makes a new bit of at least size n.
def mkbit(n):
   val = []
   x = 1
   while x < n+1:
      x = (x<<1)
   for i in range(x):
      val.append(0)
   return val


# Get # of cases.
nC = int(input())

# Process cases.
for loop in range(nC):

   toks = input().split()
   n = int(toks[0])
   q = int(toks[1])
   tmp = input().strip()
   s = []

   # I couldn't figure out how to letters in strings so I made my string
   # a list of integers. Pretty terrible hack. There has to be a better way.
   for i in range(len(tmp)):
      if tmp[i] == 'U':
         s.append(0)
      elif tmp[i] == 'C':
         s.append(1)
      else:
         s.append(2)

   # Better if this was an list of bits. I was being lazy.
   bitu = mkbit(n+2)
   bitc = mkbit(n+2)
   bitf = mkbit(n+2)

   # Go through the letters to add to the appropriate bit.
   for i in range(len(s)):
      
      if s[i] == 0:
         add(bitu,i+1,1)
         
      if s[i] == 1:
         add(bitc,i+1,1)
         
      if s[i] == 2:
         add(bitf,i+1,1)
         
   # Go through the queries.
   for i in range(q):

       toks = input().split()
       t = int(toks[0])

      # We're changing.
       if t == 1:

          # Get the new character and convert it to a number.
          idx = int(toks[1])
          tmp = toks[2][0]
          newC = 0
          if tmp == 'C':
             newC = 1
          if tmp == 'F':
             newC = 2
          oldC = s[idx]
          s[idx] = newC

          # Update the appropriate bit. Yes, this is horrible.
          if oldC == 0:
             add(bitu,idx+1,-1)
          if oldC == 1:
             add(bitc,idx+1,-1)
          if oldC == 2:
             add(bitf,idx+1,-1)
          if newC == 0:
             add(bitu,idx+1,1)
          if newC == 1:
             add(bitc,idx+1,1)
          if newC == 2:
             add(bitf,idx+1,1)

       # Query...
       else:

         # Don't forget to keep the bit 1 based.
         lo = int(toks[1])
         hi = int(toks[2])
         uCnt = rangeq(bitu,lo+1,hi+1)
         cCnt = rangeq(bitc,lo+1,hi+1)
         fCnt = rangeq(bitf,lo+1,hi+1)

         # Ta da!
         if uCnt == cCnt and cCnt == fCnt:
            print("YES")
         else:
            print("NO")
             
