#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  cin >> s;
  bool a = 0;
  for (int i = 0; i < n; ++i)
    for (int len = 1; i + 4 * len < n; ++len) {
      bool g = 1;
      for (int j = 0; j < 5; ++j)
        if (s[i + j * len] == '.') g = 0;
      a |= g;
    }
  if (a)
    puts("yes");
  else
    puts("no");
}
