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. [Image] 

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 n 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 i_1, he can make a sequence of jumps through the platforms i_1 < i_2 < ... < i_{k}, if i_2 - i_1 = i_3 - i_2 = ... = i_{k} - i_{k} - 1. Of course, all segments i_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 i_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.


-----Input-----

The first line contains integer n (1 ≤ n ≤ 100) — the number of segments on the level.

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


-----Output-----

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


-----Examples-----
Input
16
.**.*..*.***.**.

Output
yes
Input
11
.*.*...*.*.

Output
no


-----Note-----

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

Source: codeforces | Difficulty: EASY
Tags: Implementation

Complete search


Solutions:
def findit(n, st):
	for i in range(n):
		for j in range(1, n // 4 + 1):
			if i + 4 * j < n and st[i] == '*' and (st[i + j] == '*') and (st[i + 2 * j] == '*') and (st[i + 3 * j] == '*') and (st[i + 4 * j] == '*'):
				print('yes')
				return
	print('no')
n = int(input())
st = input()
findit(n, st)


import collections
input()
m = collections.defaultdict(set)
for (i, ch) in enumerate(input()):
	if ch == '*':
		m[i]
		for j in tuple(m):
			if i != j:
				m[min(i, j)].add(max(i, j) - min(i, j))
for node in sorted(m):
	for size in m[node]:
		count = 0
		current_node = node
		while count != 4:
			if size in m[current_node]:
				current_node += size
				count += 1
			else:
				break
		if count == 4:
			print('yes')
			exit()
print('no')


n = int(input())
s = input()
indices = []
for i in range(n):
	if s[i] == '*':
		indices.append(i)
ans = 'no'
for i in range(1, 26):
	for j in indices:
		if j + i in indices and j + 2 * i in indices and (j + 3 * i in indices) and (j + 4 * i in indices):
			ans = 'yes'
print(ans)


n = int(input())
level = input().strip()
for l in range(1, n + 1):
	for i in range(n - l + 1):
		for j in range(5):
			if i + l * j >= n or level[i + l * j] == '.':
				break
		else:
			print('yes')
			return
print('no')


n = int(input())
str = input()
ar = []
for i in range(n):
	if str[i] == '*':
		ar.append(i)
flag = False
if len(ar) < 5:
	print('no')
else:
	for i0 in range(len(ar) - 4):
		i1 = i0 + 1
		while i1 < len(ar) - 3:
			diff = ar[i1] - ar[i0]
			i2 = i1 + 1
			while i2 < len(ar) - 2:
				if ar[i2] - ar[i1] > diff:
					break
				elif ar[i2] - ar[i1] == diff:
					i3 = i2 + 1
					while i3 < len(ar) - 1:
						if ar[i3] - ar[i2] > diff:
							break
						elif ar[i3] - ar[i2] == diff:
							i4 = i3 + 1
							while i4 < len(ar):
								if ar[i4] - ar[i3] > diff:
									break
								elif ar[i4] - ar[i3] == diff:
									flag = True
									break
								i4 += 1
						if flag:
							break
						i3 += 1
				if flag:
					break
				i2 += 1
			if flag:
				break
			i1 += 1
		if flag:
			break
	if flag:
		print('yes')
	else:
		print('no')


(n, s) = (int(input()), input())
for i in range(1, len(s)):
	for j in range(len(s)):
		if s[j] == '.':
			continue
		L = s[j::i]
		mx = 0
		c = 1
		for k in range(1, len(L)):
			if L[k] == L[k - 1] and L[k] == '*':
				c += 1
			else:
				c = 1
			mx = max(mx, c)
		if mx == 5:
			print('yes')
			exit(0)
print('no')


n = int(input())
st = input()
st2 = [0] * n

def sum(a, m):
	return st2[a] + st2[a + m] + st2[a + 2 * m] + st2[a + 3 * m] + st2[a + 4 * m]
for i in range(n):
	if st[i] == '*':
		st2[i] = 1
step = (n - 1) // 4
t = 0
for i in range(n):
	m = 1
	while i + 4 * m < n:
		if sum(i, m) == 5:
			t = 1
			break
		m += 1
if t == 0:
	print('no')
else:
	print('yes')


n = int(input())
arr = list(input())
ans = False
for i in range(n):
	if arr[i] == '*':
		for j in range(1, n // 4 + 1):
			x = 0
			for z in range(i, n, j):
				if arr[z] == '*':
					x += 1
				else:
					break
			if x >= 5:
				ans = True
if ans:
	print('yes')
else:
	print('no')


(n, level) = (int(input()), input())
print(('no', 'yes')[any(('*****' in level[start::jump] for jump in range(1, n // 4 + 1) for start in [i for i in range(n) if level[i] == '*']))])


n = int(input())
lvl = input()
for start in range(0, 107):
	for jump in range(1, 40):
		if start + jump + jump + jump + jump >= len(lvl):
			break
		if lvl[start] == lvl[start + jump] == lvl[start + jump + jump] == lvl[start + jump + jump + jump] == lvl[start + jump + jump + jump + jump] == '*':
			print('yes')
			exit(0)
print('no')


n = int(input())
s = input()
for i in range(n):
	if s[i] == '*':
		for j in range(1, int((n - 1 - i) / 4) + 1):
			if s[i] == '*' and s[i + j] == '*' and (s[i + 2 * j] == '*') and (s[i + 3 * j] == '*') and (s[i + 4 * j] == '*'):
				print('yes')
				exit(0)
print('no')


import itertools

def king():
	n = int(input())
	s = input()
	a = []
	for i in range(len(s)):
		if s[i] == '*':
			a.append(i + 1)
	if len(a) < 5:
		print('no')
		return
	for arr in itertools.combinations(a, 5):
		arr = sorted(arr)
		mine = []
		for i in range(4):
			mine.append(arr[i + 1] - arr[i])
		if len(set(mine)) == 1:
			print('yes')
			return
	print('no')
	return
king()


n = int(input())
layout = input()
num = 2

def check(n1, n2):
	global num
	k = abs(n2 - n1)
	extra = abs(n2 - n1)
	while max(n2, n1) + k < n:
		if layout[max(n2, n1) + k] != '*':
			break
		else:
			k += extra
			num += 1
for n1 in range(0, n):
	for n2 in range(0, n):
		num = 2
		if layout[n1] == '*' and layout[n2] == '*' and (n1 != n2):
			check(n1, n2)
			if num >= 5:
				break
		if num >= 5:
			break
	if num >= 5:
		break
if num < 5:
	print('no')
else:
	print('yes')


def main():
	n = int(input())
	S = input()
	fl = 0
	for i in range(len(S) - 3):
		if S[i] == '.':
			continue
		else:
			for j in range(1, len(S) // 4 + 1):
				for k in range(5):
					if i + k * j >= len(S) or S[i + k * j] == '.':
						break
				else:
					fl = 1
					break
		if fl:
			break
	if fl:
		print('yes')
	else:
		print('no')
main()


from math import ceil

def solution(n, level):
	max_jump = ceil(n / 4) - 1
	platforms = [i for i in range(n) if level[i] == '*']
	if platforms:
		for platform in platforms:
			for jump in range(1, max_jump + 1):
				try:
					if level[platform + jump] == '*' and level[platform + jump * 2] == '*' and (level[platform + jump * 3] == '*') and (level[platform + jump * 4] == '*'):
						return 'yes'
				except IndexError:
					break
	return 'no'
n = int(input())
level = input()
print(solution(n, level))


def main():
	segments = eval(input())
	dungeon = input()
	result = 'no'
	for startseg in range(1, segments - 1):
		if dungeon[startseg - 1] != '.':
			for stepsize in range(1, int(int(segments - startseg) / 4) + 1):
				if '.' not in dungeon[startseg - 1:startseg + 5 * stepsize - 1:stepsize]:
					print('yes')
					return
	print('no')
main()


from math import ceil
(n, level) = (int(input()), input())
print(('no', 'yes')[any(('*****' in level[start::jump] for jump in range(1, ceil(n / 4)) for start in [i for i in range(n) if level[i] == '*']))])


n = int(input())
s = input().strip()
print('yes' if '*****' in '.'.join((s[i::j] for i in range(n) for j in range(1, n))) else 'no')


def main():
	(n, s) = (int(input()), input())
	for step in range(1, (n + 3) // 4):
		for start in range(step):
			if '*****' in s[start::step]:
				print('yes')
				return
	print('no')
main()


def solve(level):
	level_size = len(level)

	def check(k, l):
		c = 0
		while k + l < level_size and '*' == level[k + l]:
			c += 1
			k += l
		return c >= 4
	for i in range(level_size):
		if '*' == level[i]:
			for j in range(i + 1, level_size):
				if '*' == level[j] and check(i, j - i):
					return 'yes'
	return 'no'
input()
print(solve(input().strip()))


from sys import stderr
n = int(input())
level = input().strip()
good = False
max_jump_size = (n - 5) // 4
for jump_len in range(max_jump_size + 1):
	for startIdx in range(n - 4 - jump_len * 4):
		for i in range(5):
			if level[startIdx + i * jump_len + i] == '.':
				break
		else:
			good = True
		if good:
			break
	if good:
		break
print('yes' if good else 'no')


import sys
n = int(sys.stdin.readline())
s = sys.stdin.readline().strip()
res = 'no'
for start in range(n):
	for l in range(1, n):
		for j in range(start, start + l * 5, l):
			if j >= n:
				break
			if s[j] == '.':
				break
			if j == start + l * 4:
				res = 'yes'
print(res)


a = int(input())
k = input()
b = [i for i in range(a) if k[i] == '*']
for i in b:
	for j in range(1, 101):
		ok = 1
		for x in range(1, 5):
			if i + j * x not in b:
				ok = 0
				break
		if ok:
			exit(print('yes'))
print('no')


n = int(input())
s = input().strip()
for i in range(n):
	DP = [0] * n
	for j in range(n):
		if s[j] == '*':
			DP[j] = 1
			if j >= i and s[j - i] == '*':
				DP[j] += DP[j - i]
	if max(DP) >= 5:
		print('yes')
		exit(0)
print('no')


from sys import stdin, stdout
n = int(stdin.readline())
lev = stdin.readline()
res = 'no'
for first_i in range(n - 4):
	if lev[first_i] == '*':
		max_step = int((n - 1 - first_i) / 4)
		for step_i in range(1, max_step + 1):
			res = 'yes'
			for i in range(1, 5):
				if lev[first_i + step_i * i] != '*':
					res = 'no'
					break
			if res == 'yes':
				break
		if res == 'yes':
			break
stdout.write(res)


(n, s) = (int(input()), input())
for i in range(1, len(s)):
	for j in range(len(s)):
		if s[j::i][:5] == '*' * 5:
			print('yes')
			exit(0)
print('no')


n = int(input())
s = input().strip()
f = False
for i in range(1, n):
	for j in range(n):
		x = j
		c = 0
		while x < n:
			if s[x] == '*':
				c += 1
			else:
				c = 0
			if c == 5:
				f = True
			x += i
if f:
	print('yes')
else:
	print('no')


from sys import stdin, stdout
n = int(stdin.readline())
lev = stdin.readline()
res = any((lev[start::step][:5] == '*****' for start in range(0, n) for step in range(1, int(n / 4) + 1)))
stdout.write(('no', 'yes')[res])


import sys, os
import fileinput
n = int(input())
s = input().strip()
for i in range(1, n + 1):
	for j in range(1, n + 1):
		if j - 1 >= n or j - 1 + i >= n or j - 1 + 2 * i >= n or (j - 1 + 3 * i >= n) or (j - 1 + 4 * i >= n):
			break
		t = '%s%s%s%s%s' % (s[j - 1], s[j - 1 + i], s[j - 1 + 2 * i], s[j - 1 + 3 * i], s[j - 1 + 4 * i])
		if t == '*****':
			print('yes')
			return
print('no')


def findOccurrences(s, ch):
	return [i for (i, letter) in enumerate(s) if letter == ch]
list = []
n = int(input())
name = input()
list = findOccurrences(name, '*')
try:
	for i in list:
		p = 1
		while p < n:
			j = p
			count = 1
			while i + j < n:
				if name[i + j] == '*':
					count = count + 1
				else:
					count = 0
				if count == 5:
					print('yes')
					raise Exception
				j = j + p
			p = p + 1
	print('no')
except Exception:
	pass


class CodeforcesTask526ASolution:

	def __init__(self):
		self.result = ''
		self.n = 0
		self.level = ''

	def read_input(self):
		self.n = int(input())
		self.level = input()

	def process_task(self):
		can = False
		for y in range(1, self.n):
			for x in range(self.n - y - 1):
				do = True
				for z in range(5):
					if x + z * y >= self.n:
						do = False
						break
					if self.level[x + z * y] != '*':
						do = False
						break
				if do:
					can = do
					break
			if can:
				break
		self.result = 'yes' if can else 'no'

	def get_result(self):
		return self.result
Solution = CodeforcesTask526ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


n = int(input())
s = input().strip()
result = False
for i in range(n - 4):
	for j in range(1, (n - i - 1) // 4 + 1):
		if s[i:i + 4 * j + 1:j] == '*****':
			result = True
if result:
	print('yes')
else:
	print('no')


import sys
f = sys.stdin
n = int(f.readline().strip())
a = f.readline().strip()
res = False
if n > 3 and n // 5 > 0:
	for i in range(1, n // 4 + 2):
		for j in range(n - 4):
			if j + i * 4 < n:
				if a[j] == '*' and a[j + i] == '*' and (a[j + 2 * i] == '*') and (a[j + 3 * i] == '*') and (a[j + 4 * i] == '*'):
					res = True
					break
		if res:
			break
if res:
	print('yes')
else:
	print('no')


def king(s):
	l = []
	for i in range(len(s)):
		if s[i] == '*':
			l.append(i)
	if len(l) < 5:
		print('no')
	else:
		k = (max((x for x in l)) - min((x for x in l))) // 4

		def space_eq(s, j):
			ans = False
			for i in s:
				if i + j in s and i + 2 * j in s and (i + 3 * j in s) and (i + 4 * j in s):
					ans = True
					break
			return ans
		ans = False
		for j in range(1, k + 1):
			if space_eq(l, j) == True:
				ans = True
				break
		if ans == True:
			print('yes')
		else:
			print('no')
n = int(input())
s = input()
assert len(s) == n, 'Incorrect Input'
king(s)


(n, s, r) = (int(input()), input(), range)
print(['yes', 'no'][all(('.' in s[i:i + 5 * j:j] for i in r(n - 4) for j in r(1, (n - i + 3) // 4)))])


n = int(input())
s = input()
for i in range(1, n // 4 + 1):
	for j in range(i):
		if s[j::i].find('*****') != -1:
			print('yes')
			exit()
print('no')


(n, t) = (int(input()), input())
for i in range(n - 4):
	if t[i] == '*':
		for d in range(1, (n - i + 3) // 4):
			if t[i + d] == t[i + 2 * d] == t[i + 3 * d] == t[i + 4 * d] == '*':
				print('yes')
				exit()
print('no')


n = int(input())
s = input()
flag = False
for k in range(1, (n + 3) // 4):
	for i in range(n - 4 * k):
		flag = True
		for j in range(5):
			if s[i + j * k] != '*':
				flag = False
		if flag:
			break
	if flag:
		break
if flag:
	print('yes')
else:
	print('no')


from functools import reduce
from operator import *
from math import *
from sys import *
setrecursionlimit(10 ** 7)
RI = lambda : list(map(int, input().split()))
RS = lambda : input().rstrip().split()
n = RI()[0]
x = RS()[0]
for i in range(n):
	for j in range(1, n):
		if x[i::j][:5] == '*' * 5:
			print('YES')
			exit(0)
print('NO')


def main():
	n = int(input())
	s = input().rstrip()
	ar = [0] * n
	for i in range(n):
		for l in range(1, n):
			j = i
			sum1 = 0
			while j >= 0:
				if s[j] == '*':
					sum1 += 1
				else:
					break
				j -= l
			if sum1 >= 5:
				print('yes')
				return
	print('no')
main()


n = int(input())
s = input()
f = False
for i in range(n):
	if s[i] == '*':
		for j in range(1, n // 4 + 1):
			if i + 4 * j < n and s[i] == s[i + j] == s[i + 2 * j] == s[i + 3 * j] == s[i + 4 * j]:
				f = True
				break
if f:
	print('yes')
else:
	print('no')


n = int(input())
s = input()
print('yes' if any((any((all((s[i + k * j] == '*' for k in range(5))) for j in range(1, (n - i + 3) // 4))) for i in range(n - 4))) else 'no')


import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n')]

def st():
	return input().rstrip('\n')

def val():
	return int(input())

def solve():
	for i in range(len(s)):
		if s[i] == '*':
			for j in range(i):
				try:
					if s[i + 3 * (i - j)] == '*' and s[j] == '*' and (s[i + (i - j)] == '*') and (s[i + 2 * (i - j)] == '*'):
						return 'yes'
				except:
					continue
	return 'no'
n = val()
s = st()
print(solve())


I = input
R = range
n = int(I())
s = I()
print(['no', 'yes'][any((max(map(len, s[j::i + 1].split('.'))) > 4 for i in R(n // 4) for j in R(i + 1)))])


def check():
	for i in range(n):
		for j in range(1, n - i - 1):
			num = 0
			pos = i
			while pos < n and a[pos] == '*':
				num += 1
				pos += j
			if num == 5:
				return True
	return False
n = int(input())
a = input()
if check():
	print('yes')
else:
	print('no')


n = int(input())
line = input()
check = False
for i in range(1, n // 4 + 1):
	for j in range(n - i * 4):
		if line[j] == '*':
			if line[j] == line[j + i] == line[j + 2 * i] == line[j + 3 * i] == line[j + 4 * i]:
				print('yes')
				check = True
				break
	if check:
		break
if not check:
	print('no')


n = int(input())
ch = input()
ans = False
for i in range(n):
	if not ans:
		for j in range(1, (n - i + 3) // 4):
			if not ans:
				ans = True
				for k in range(5):
					if ch[i + k * j] == '.':
						ans = False
						break
print('yes' if ans else 'no')


(n, lev) = (int(input()), input())
res = any((lev[start::step][:5] == '*****' for start in range(0, n) for step in range(1, int(n / 4) + 1)))
print(('no', 'yes')[res])


n = int(input())
s = input() + '.' * 600
has = False
for dif in range(1, 101):
	for st in range(100):
		if s[st] == s[st + dif] == s[st + 2 * dif] == s[st + 3 * dif] == s[st + 4 * dif] == '*':
			has = True
print('yes' if has else 'no')


n = int(input())
s = input()
for ln in range(1, n):
	for i in range(n):
		if i + ln * 4 < n:
			if s[i] == s[i + ln] == s[i + ln * 2] == s[i + ln * 3] == s[i + ln * 4] == '*':
				print('yes')
				exit()
print('no')


import itertools
n = int(input())
s = input()
ok = False
for i in range(n):
	for jump in range(1, n):
		if i + 4 * jump < n:
			for (j, c) in enumerate(itertools.islice(s, i, i + 5 * jump, jump)):
				if c == '.':
					break
			else:
				if not ok:
					print('yes')
					ok = True
				break
if not ok:
	print('no')


n = int(input())
s = input().rstrip()
d = [[1 for i in range(n)] for i in range(n)]
maxx = 0
for i in range(n):
	if s[i] == '.':
		continue
	maxx = max(maxx, max(d[i]))
	for j in range(n):
		if i + j >= n:
			break
		d[i + j][j] = max(d[i + j][j], d[i][j] + 1)
print('yes' if maxx >= 5 else 'no')


n = int(input())
s = input()
i = 0
while i < n:
	j = i + 1
	while j < n:
		if s[i] == '*' and s[j] == '*':
			dis = j - i
			k = j + dis
			count = 0
			while k < n:
				if s[k] != '*':
					break
				else:
					count += 1
				k += dis
			if count >= 3:
				print('yes')
				quit()
		j += 1
	i += 1
print('no')


__author__ = 'artyom'

def main():
	n = read()
	s = read(0)
	for i in range(n - 4):
		j = 1
		while i + j * 4 < n:
			if s[i] == '*' and s[i + j] == '*' and (s[i + 2 * j] == '*') and (s[i + 3 * j] == '*') and (s[i + 4 * j] == '*'):
				return 'yes'
			j += 1
	return 'no'

def read(mode=1, size=None):
	if mode == 0:
		return input().strip()
	if mode == 1:
		return int(input().strip())
	if mode == 2:
		return input().strip().split()
	if mode == 3:
		return list(map(int, input().strip().split()))
	a = []
	for _ in range(size):
		a.append(read(3))
	return a

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, tuple) or isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='\n')
write(main())


import unittest
import sys
import re
import random

class Jump:

	def __init__(self, args):
		self.args = args
		self.size = args[0]
		self.maze = args[1]
		self.dist = []
		self.cur_dist = []
		self.calc_dist()

	def calc_dist(self):
		distance = 0
		start = 0
		for m in self.maze:
			if not start:
				if m:
					start = 1
				continue
			distance += 1
			if m:
				self.dist.append(distance)
				distance = 0

	def next(self):
		self.cur_dist[1] = self.cur_dist[0] + self.cur_dist[1]
		del self.cur_dist[0]

	def iterate(self):
		len = self.cur_dist[0]
		hop_len = 0
		hops = 0
		for m in self.cur_dist:
			hop_len += m
			if hop_len == len:
				hop_len = 0
				hops += 1
			if hops == 4:
				return 1
			if hop_len > len:
				return 0
		return 0

	def iterate_all(self):
		while len(self.cur_dist) > 1:
			if self.iterate():
				return 1
			self.next()
		return 0

	def calculate(self):
		for i in range(len(self.dist)):
			self.cur_dist = list(self.dist[i:])
			if self.iterate_all():
				return 'yes'
		return 'no'

def decode_inputs(inputs):
	size = int(inputs[0])
	maze = [0 if i == '.' else 1 for i in inputs[1]]
	args = (size, maze)
	return args

def calculate(inputs):
	return Jump(decode_inputs(inputs)).calculate()

def main():
	inputs = (input(), input())
	print(calculate(inputs))

class unitTests(unittest.TestCase):

	def test_decode_inputs(self):
		self.assertEqual(decode_inputs(('4', '.*.*')), (4, [0, 1, 0, 1]))

	def test_Jump_class__basic_functions(self):
		d = Jump((7, [0, 1, 0, 1, 1, 0, 1]))
		self.assertEqual(d.size, 7)
		self.assertEqual(d.dist, [2, 1, 2])
		d.cur_dist = [2, 1, 2]
		d.next()
		self.assertEqual(d.cur_dist, [3, 2])
		d.cur_dist = [2, 2, 2, 2]
		self.assertEqual(d.iterate(), 1)
		d.cur_dist = [2, 1, 1, 2, 2]
		self.assertEqual(d.iterate(), 1)
		d.cur_dist = [2, 3]
		self.assertEqual(d.iterate(), 0)
		d.cur_dist = [2, 1, 3, 3, 3]
		self.assertEqual(d.iterate_all(), 1)
		d.cur_dist = [2, 1, 3, 3, 2]
		self.assertEqual(d.iterate_all(), 0)
		d.dist = [20, 2, 2, 2, 2]

	def test_calculate(self):
		self.assertEqual(calculate(('16', '.**.*..*.***.**.')), 'yes')
		self.assertEqual(calculate(('11', '.*.*...*.*.')), 'no')
if sys.argv[-1] == '-ut':
	unittest.main(argv=[' '])
main()


n = int(input())
arr = list(input())
flag = False
for i in range(n):
	if arr[i] == '*':
		for d in range(1, n):
			begin = i
			for k in range(4):
				if begin + d < n and arr[begin + d] == '*':
					begin += d
				else:
					break
			else:
				flag = True
				break
	if flag:
		break
if flag:
	print('yes')
else:
	print('no')


n = int(input())
s = input()
if n < 5:
	print('no')
else:
	for l in range(1, n - 3):
		ans = 0
		for st in range(n):
			fl = 0
			if s[st] == '.':
				continue
			else:
				cn = 0
				for j in range(st + l, n, l):
					if s[j] == '.':
						fl = 1
						cn = -1
					else:
						cn += 1
						if cn == 4:
							fl = 3
							break
			if fl == 3:
				ans = 1
				break
		if ans == 1:
			break
	if ans == 1:
		print('yes')
	else:
		print('no')


n = int(input())
l = []
ch = input()
for i in range(n):
	if ch[i] == '*':
		l.append(i + 1)
i = 0
s = 0
while i < len(l) - 1 and s < 4:
	s = 1
	j = i + 2
	d = l[i + 1] - l[i]
	a = l[i + 1]
	while j < len(l) and s < 4:
		if l[j] - a > d:
			a = l[j]
			d = a - l[i]
			s = 1
		elif l[j] - a == d:
			s = s + 1
			a = l[j]
		j = j + 1
	if s < 4:
		i = i + 1
if s == 4:
	print('yes')
else:
	print('no')


n = int(input())
s = input()
for i in range(len(s)):
	if s[i] == '*':
		j = 1
		f = False
		while i + j * 4 < len(s):
			for k in range(1, 5):
				if s[i] != s[i + k * j]:
					break
			else:
				f = True
				break
			j += 1
		if f:
			print('yes')
			break
else:
	print('no')


n = int(input())
lis = list(input())
for i in range(n):
	if lis[i] == '*':
		for j in range(1, 25):
			c = 0
			for k in range(i + j, n, j):
				if lis[k] == '*':
					c += 1
				else:
					break
			if c >= 4:
				print('yes')
				exit()
print('no')


def main():
	n = int(input())
	s = input()

	def ind():
		for (i, j) in enumerate(s):
			if j == '*':
				for k in range(1, (n - 1) // 4 + 1):
					yield slice(i, i + 4 * k + 1, k)
	for i in ind():
		if s[i] == '*****':
			print('yes')
			return
	print('no')
main()


n = int(input())
level = input()
yes = False
for i in range(n):
	for j in range(n):
		count = 0
		f = 5
		a = []
		for k in range(i, n, j + 1):
			if f > 0:
				if level[k] == '*':
					count += 1
			f -= 1
		if count >= 5:
			yes = True
if yes:
	print('yes')
else:
	print('no')


n = int(input())
s = input()
for i in range(n):
	for j in range(1, n):
		t = s[i::j]
		if t.find('*' * 5) != -1:
			print('yes')
			exit()
print('no')


from collections import defaultdict, deque, Counter, OrderedDict
from bisect import insort, bisect_right, bisect_left
import threading, sys

def main():
	n = int(input())
	s = [c for c in input()]
	pos = []
	for (i, c) in enumerate(s):
		if c == '*':
			pos.append(i + 1)
	arr = [0] * 102
	for c in pos:
		arr[c] = 1
	for i in range(1, 101):
		for k in pos:
			check = 0
			for j in range(5):
				if k + j * i < 102:
					check += arr[k + j * i]
			if check == 5:
				print('yes')
				exit(0)
	print('no')
thread = threading.Thread(target=main)
thread.start()


kk = 0
x = int(input())
y = input()
z = [i for i in range(len(y)) if y[i] == '*']
for i in range(0, 100):
	for j in range(1, 100):
		if i in z and i + j in z and (i + 2 * j in z) and (i + 3 * j in z) and (i + 4 * j in z):
			kk = 1
if kk == 1:
	print('yes')
else:
	print('no')


n = int(input())
s = input()
ans = 'no'
for i in range(len(s)):
	if s[i] == '.':
		continue
	for d in range(1, 100):
		cnt = 1
		j = i + d
		while cnt < 5:
			if j >= len(s):
				break
			if s[j] == '.':
				break
			cnt += 1
			j += d
		if cnt == 5:
			ans = 'yes'
			break
	if ans == 'yes':
		break
print(ans)


from sys import stdin, stdout
n = int(stdin.readline())
lev = stdin.readline()
res = False
for first_i in range(n - 4):
	if lev[first_i] == '*':
		max_step = int((n - 1 - first_i) / 4)
		for step_i in range(1, max_step + 1):
			ver = lev[first_i:first_i + step_i * 4 + 1:step_i]
			res = all((l == '*' for l in ver))
			if res:
				break
		if res:
			break
stdout.write(('no', 'yes')[res])


n = int(input())
s = input()
for i in range(len(s)):
	if s[i] != '*':
		continue
	for j in range(1, len(s)):
		cur = i
		cnt = 0
		while cur < len(s):
			if s[cur] == '*':
				cnt += 1
			else:
				break
			cur += j
		if cnt >= 5:
			print('yes')
			exit(0)
print('no')


n = int(input())
d = list(input())
dun = list()
ok = False
initial = 0
for i in range(len(d)):
	if d[i] == '.':
		dun.append(False)
	else:
		dun.append(True)
		if ok == False:
			initial = i
			ok = True
ok = False
if (n - initial) // 4 == 0:
	print('no')
else:
	while initial + 1 < len(dun) and (not ok):
		for i in range(1, (n - initial) // 4 + 1):
			nok = False
			count = 0
			for j in range(initial, n, i):
				if dun[j] == False:
					nok = True
					break
				else:
					count += 1
				if count == 5:
					break
			if nok == False and count == 5:
				ok = True
				break
		if not ok:
			initial += 1
			while initial + 1 > len(dun) and dun[initial] == False:
				initial += 1
		else:
			break
	if not ok:
		print('no')
	else:
		print('yes')


import math

def main():
	n = int(input().strip())
	level = input().strip()
	for jump in range(1, math.ceil(n / 4)):
		for i in range(0, n - jump * 4):
			jumps = 0
			if level[i] == '.':
				continue
			for j in range(1, 5):
				if level[i + j * jump] == '*':
					jumps += 1
			if jumps == 4:
				print('yes')
				return
	print('no')
main()


from math import ceil

def solution(n, level):
	max_jump = ceil(n / 4) - 1
	platforms = [i for i in range(n) if level[i] == '*']
	ans = any(('*****' in level[start::jump] for jump in range(1, max_jump + 1) for start in platforms))
	return ('no', 'yes')[ans]
n = int(input())
level = input()
print(solution(n, level))


import sys
n = int(input())
S = input()
for l in range(n):
	if S[l] == '*':
		d = 1
		while l + 4 * d < n:
			if S[l + d] == S[l + 2 * d] == S[l + 3 * d] == S[l + 4 * d] == '*':
				print('yes')
				return
			d += 1
print('no')


from math import *
n = int(input())
a = input()
A = []
for i in range(n):
	if ord(a[i]) == 42:
		A.append(1)
	else:
		A.append(0)
counter = 0
for i in range(1, n):
	for j in range(len(A) - 4 * i):
		if A[j] + A[j + i] + A[j + 2 * i] + A[j + 3 * i] + A[j + 4 * i] == 5:
			counter += 1
if counter == 0:
	print('no')
else:
	print('yes')


n = int(input())
pl = input()
dp = []
for i in range(n + 1):
	temp = []
	for j in range(n + 1):
		temp.append(-1)
	dp.append(temp)
best = 0
for (i, v) in enumerate(pl):
	if v == '.':
		continue
	for j in range(1, n + 1, 1):
		dp[j][i] = dp[j][i - j] + 1 if i - j >= 0 and dp[j][i - j] != -1 else 0
		best = max(best, dp[j][i])
		if best == 4:
			break
	if best == 4:
		break
print('no' if best < 4 else 'yes')


n = input()
s = input()
good = False
for i in range(0, int(n)):
	for j in range(1, 27):
		try:
			if s[i] == '*' and s[i + j] == '*' and (s[i + 2 * j] == '*') and (s[i + 3 * j] == '*') and (s[i + 4 * j] == '*'):
				good = True
		except:
			pass
if good:
	print('yes')
else:
	print('no')


bl = '*'

def fi(s, n):
	for c in range(n):
		if s[c] == bl:
			yield c

def ig(s, n):
	fs = list(fi(s, n))
	if len(fs) == 0:
		return 0
	for c in range(1, (n - fs[0]) // 4 + 1):
		for d in fs:
			if s[d:d + 5 * c:c] == 5 * bl:
				return 1
	return 0
n = int(input())
s = input()
s = 'yes' if ig(s, n) else 'no'
print(s)


n = int(input())
s = input()
flag = False
for i in range(n):
	for k in range(1, n):
		if i + 4 * k < n:
			if s[i] == '*' and s[i + k] == '*' and (s[i + 2 * k] == '*') and (s[i + 3 * k] == '*') and (s[i + 4 * k] == '*'):
				flag = True
if flag == True:
	print('yes')
else:
	print('no')


import re
import inspect
from sys import argv, exit

def rstr():
	return input()

def rint():
	return int(input())

def rints(splitchar=' '):
	return [int(i) for i in input().split(splitchar)]

def varnames(obj, namespace=globals()):
	return [name for name in namespace if namespace[name] is obj]

def pvar(var, override=False):
	prnt(varnames(var), var)

def prnt(*args, override=False):
	if '-v' in argv or override:
		print(*args)
n = rint()
s = rstr()
course = [1 if c == '*' else 0 for c in s]
prnt(course)
for (i, c) in enumerate(course):
	if not c:
		prnt(c)
		continue
	else:
		prnt('Using c=', i)
		for j in range(1, len(course)):
			if i + j * 4 >= len(course):
				break
			if course[i + j] and course[i + j * 2] and course[i + j * 3] and course[i + j * 4]:
				print('yes')
				exit(0)
print('no')


from sys import stdin, stdout

def main():
	n = int(stdin.readline())
	s = stdin.readline()
	for i in range(n):
		if s[i] == '*':
			for j in range(1, (n - i) // 4 + 1):
				if i + j * 4 < n and s[i] == s[i + j] == s[i + j + j] == s[i + 3 * j] == s[i + j * 4]:
					stdout.write('yes')
					exit()
	stdout.write('no')
main()