#include <bits/stdc++.h>
double const EPS = 3e-8;
using namespace std;
template <class T>
T gcd(T a, T b) {
  return (b != 0 ? gcd<T>(b, a % b) : a);
}
template <class T>
T lcm(T a, T b) {
  return (a / gcd<T>(a, b) * b);
}
template <class T>
inline bool read(T &x) {
  int c = getchar();
  int sgn = 1;
  while (~c && c < '0' || c > '9') {
    if (c == '-') sgn = -1;
    c = getchar();
  }
  for (x = 0; ~c && '0' <= c && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  x *= sgn;
  return ~c;
}
string inp;
int main() {
  int n = ({
    int a;
    read(a);
    a;
  });
  cin >> inp;
  int i, sz = n, j;
  bool ok = 1;
  for (i = sz - 1; i >= 3 && ok; i--) {
    if (inp[i] == '.') continue;
    for (j = 1; j <= 100 && ok; j++) {
      int now = i;
      int cnt = 0;
      while (1) {
        now -= j;
        if (now < 0) break;
        if (inp[now] == '.') break;
        cnt++;
        if (cnt >= 4) {
          ok = 0;
          break;
        }
      }
    }
  }
  puts(ok ? "no" : "yes");
  return 0;
}
