#CODEFORCESP7019. Football
Football
Football
题面翻译
足球场上有 人,分为 两队,它们的位置可以用 ( 队)或 ( 队)表示。一般认为,一个队里面凡是有连续 个队员站在一起就是危险的。现在给定他们的站位,判断是否危险。
输入仅一行,为一个长度为 的 串,含义如题意所述。 输出仅一行,如果这种站位危险输出 ,否则输出 。
题目描述
Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a string consisting of zeroes and ones. A zero corresponds to players of one team; a one corresponds to players of another team. If there are at least players of some team standing one after another, then the situation is considered dangerous. For example, the situation is dangerous and is not. You are given the current situation. Determine whether it is dangerous or not.
输入格式
The first input line contains a non-empty string consisting of characters "0" and "1", which represents players. The length of the string does not exceed characters. There's at least one player from each team present on the field.
输出格式
Print "YES" if the situation is dangerous. Otherwise, print "NO".
样例 #1
样例输入 #1
001001
样例输出 #1
NO
样例 #2
样例输入 #2
1000000001
样例输出 #2
YES