CF526A.King of Thieves

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

In this problem you will meet the simplified model of game King of Thieves.

In a new ZeptoLab game called "King of Thieves" your aim is to reach a chest with gold by controlling your character, avoiding traps and obstacles on your way.

An interesting feature of the game is that you can design your own levels that will be available to other players. Let's consider the following simple design of a level.

A dungeon consists of nn segments located at a same vertical level, each segment is either a platform that character can stand on, or a pit with a trap that makes player lose if he falls into it. All segments have the same length, platforms on the scheme of the level are represented as '*' and pits are represented as '.'.

One of things that affects speedrun characteristics of the level is a possibility to perform a series of consecutive jumps of the same length. More formally, when the character is on the platform number i1i_{1} , he can make a sequence of jumps through the platforms i_{1}<i_{2}<...<i_{k} , if i2i1=i3i2=...=ikik1i_{2}-i_{1}=i_{3}-i_{2}=...=i_{k}-i_{k-1} . Of course, all segments i1,i2,... iki_{1},i_{2},...\ i_{k} should be exactly the platforms, not pits.

Let's call a level to be good if you can perform a sequence of four jumps of the same length or in the other words there must be a sequence i1,i2,...,i5i_{1},i_{2},...,i_{5} , consisting of five platforms so that the intervals between consecutive platforms are of the same length. Given the scheme of the level, check if it is good.

输入格式

The first line contains integer nn ( 1<=n<=1001<=n<=100 ) — the number of segments on the level.

Next line contains the scheme of the level represented as a string of nn characters '*' and '.'.

输出格式

If the level is good, print the word "yes" (without the quotes), otherwise print the word "no" (without the quotes).

输入输出样例

  • 输入#1

    16
    .**.*..*.***.**.
    

    输出#1

    yes
  • 输入#2

    11
    .*.*...*.*.
    

    输出#2

    no

说明/提示

In the first sample test you may perform a sequence of jumps through platforms 2,5,8,11,142,5,8,11,14 .

首页