------
## 最终结论
```python
def checkSubarraySum(nums, k):
    remainder_index = {0: -1}
    current_sum = 0
    for i in range(len(nums)):
        current_sum += nums[i]
        remainder = current_sum % k if k != 0 else current_sum
        if remainder in remainder_index:
            if i - remainder_index[remainder] > 1:
                return True
        if remainder not in remainder_index:
            remainder_index[remainder] = i
    return False

# Example usage:
print(checkSubarraySum([23, 2, 4, 6, 7], 6)) # Output: True
print(checkSubarraySum([23, 2, 6, 4, 7], 6)) # Output: True
```