#include <bits/stdc++.h>
const double eps = 1e-19;
const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const int MAXN = 100005;
using namespace std;
int n;
char str[MAXN];
int main() {
  cin >> n >> str;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < n; j++) {
      bool ok = true;
      for (int k = 0; k < 5; k++) {
        if (j + k * i >= n || str[j + k * i] == '.') {
          ok = false;
        }
      }
      if (ok) {
        printf("yes\n");
        return 0;
      }
    }
  }
  printf("no\n");
  return 0;
}
