#include <bits/stdc++.h>
using namespace std;
bool testc(int tc = 0) {
  int n;
  scanf("%i ", &n);
  char buf[1000];
  gets(buf);
  for (int i = 0; i < n; i++) {
    int k = 0;
    if (buf[i] == '.') continue;
    for (int j = 1; j < n; j++) {
      for (int k = 1;; k++) {
        if (k >= 5) {
          printf("yes\n");
          return true;
        }
        if (i + j * k >= n || buf[i + j * k] == '.') {
          break;
        }
      }
    }
  }
  printf("no\n");
}
int main() {
  testc();
  return 0;
}
