Implement the function can_chef_go_to_heaven that determines if Chef can go to heaven based on his good years represented in a binary string.
Functionality
The function should take in two parameters:
An integer L representing the length of the string S.
A string S consisting of L characters, where each character is either '0' or '1'. A character '1' represents a good year for Chef, while '0' represents a non-good year.
The function should evaluate at every year (index of the string):
Count the cumulative good years (count of '1' characters).
For each year, check if the number of good years is greater than or equal to half of the total years considered up to that point (inclusive).
If this condition is satisfied for any year, return "YES". If the loop completes without satisfying the condition, return "NO".
Input/Output Requirements
Input: An integer L (where 1 <= L <= 100) and a binary string S of length L.
The solution must be written in a file called /app/solution.py. Make sure to include the function signature and a suitable implementation that adheres to the requirements above.