You start with count 1 at index 0, representing the first 0. At index 1, you see another 0. Since the previous character was also 0, you increment count to 2.
From index 3 to 8, you keep seeing 1s. Each matches the previous character, so count grows: 2, 3, 4, 5, 6, 7. When count hits 7 at index 8, you immediately return YES. You don't need to check the remaining characters.