Here's your approach:
Read the string.
Initialize a counter to 1 (you've seen at least one character).
Loop through the string starting from the second character.
For each character, compare it to the previous one. If they match, increment the counter. If they differ, reset the counter to 1.
Check if the counter reaches 7. If yes, output YES and stop.
If you finish the loop without finding 7 consecutive characters, output NO. This pattern of comparing adjacent elements is common in string and array problems.