#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const long double PI = 3.14159265358979323846;
const long double gammama = 0.57721566490153286060;
const long double eps = 1e-5;
const int INF = 1000 * 1000 * 1000 + 1;
const long long LINF = (long long)1000 * 1000 * 1000 * 1000 * 1000 * 1000;
const long long mod = 1000 * 1000 * 1000 + 7;
const long long N = 1001;
void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int res = 0;
  for (int d = 1; d < n; ++d) {
    vector<int> a(n, 0);
    int m = 0;
    for (int i = 0; i < n; ++i) {
      if (s[i] == '.')
        a[i] = 0;
      else {
        if (i - d >= 0) {
          a[i] = a[i - d] + 1;
        } else
          a[i] = 1;
      }
      m = max(m, a[i]);
    }
    res = max(res, m);
  }
  if (res >= 5)
    cout << "yes";
  else
    cout << "no";
  cout << endl;
}
int main() {
  solve();
  return 0;
}
