Easy Python Solution
Code
# Code
```python3 []
class Solution:
    def waysToSplit(self, nums: List[int]) -> int:
        prefix_sum = []
        sumi = 0
        for i in nums:
            sumi += i
            prefix_sum.append(sumi)
        
        suffix_sum = []
        sumi = 0
        for i in range(len(nums) - 1, -1, -1):
            sumi += nums[i]
            suffix_sum.append(sumi)
        
        suffix_sum = suffix_sum[::-1]

        total = sum(nums)

        def findIndex(left, right, find_smallest):
            fixed_left, fixed_right = left, right
            answer = -1
            while left <= right:
                mid = (left + right) // 2
                mid_diff = total - (suffix_sum[mid] + prefix_sum[fixed_left - 2])
                
                if suffix_sum[mid] < mid_diff:
                    right = mid - 1
                elif mid_diff < prefix_sum[fixed_left - 2]:
                    left = mid + 1
                else:
                    answer = mid

                    if find_smallest:
                        right = mid - 1
                    else:
                        left = mid + 1
            
            return answer
        
        answer = 0
        for i in range(len(nums) - 2):
            smallest_index = findIndex(i + 2, len(nums) - 1, True)
            largest_index = findIndex(i + 2, len(nums) - 1, False)

            if smallest_index == -1 or largest_index == -1:
                continue

            answer += (largest_index - smallest_index) + 1
        
        return answer % ((10**9) + 7)

```
['Python3']