------
## 最终结论
```python
def can_transform(s, t):
    # Check if there is any common character between s and t
    return any(char in s for char in t)

def main():
    import sys
    input = sys.stdin.read
    data = input().split()
    
    q = int(data[0])
    index = 1
    results = []
    
    for _ in range(q):
        s = data[index]
        t = data[index + 1]
        index += 2
        
        if can_transform(s, t):
            results.append("YES")
        else:
            results.append("NO")
    
    for result in results:
        print(result)

if __name__ == "__main__":
    main()
```