Good Integer

AtCoder
IDabc079_a
Time2000ms
Memory256MB
Difficulty
We call a $4$\-digit integer with three or more consecutive same digits, such as $1118$, **good**. You are given a $4$\-digit integer $N$. Answer the question: Is $N$ **good**? ## Constraints * $1000 ≤ N ≤ 9999$ * $N$ is an integer. ## Input Input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
1118
Output #1
Yes

$N$ is **good**, since it contains three consecutive $1$.
Input #2
7777
Output #2
Yes

An integer is also **good** when all the digits are the same.
Input #3
1234
Output #3
No
API Response (JSON)
{
  "problem": {
    "name": "Good Integer",
    "description": {
      "content": "We call a $4$\\-digit integer with three or more consecutive same digits, such as $1118$, **good**. You are given a $4$\\-digit integer $N$. Answer the question: Is $N$ **good**?",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc079_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "We call a $4$\\-digit integer with three or more consecutive same digits, such as $1118$, **good**.\nYou are given a $4$\\-digit integer $N$. Answer the question: Is $N$ **good**?\n\n## Constraints\n\n*   $1...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments