#include <bits/stdc++.h>
using namespace std;
template <class C>
void mini(C& a4, C b4) {
  a4 = min(a4, b4);
}
template <class C>
void maxi(C& a4, C b4) {
  a4 = max(a4, b4);
}
template <class T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> pair) {
  return out << "(" << pair.first << ", " << pair.second << ")";
}
template <class A, class B, class C>
struct Triple {
  A first;
  B second;
  C third;
};
template <class T>
void ResizeVec(T&, vector<long long>) {}
template <class T>
void ResizeVec(vector<T>& vec, vector<long long> sz) {
  vec.resize(sz[0]);
  sz.erase(sz.begin());
  if (sz.empty()) {
    return;
  }
  for (T& v : vec) {
    ResizeVec(v, sz);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(10);
  double beg_clock = 1.0 * clock() / CLOCKS_PER_SEC;
  long long n;
  cin >> n;
  ;
  string s;
  cin >> s;
  ;
  s = ' ' + s;
  for (long long i = (1); i <= (n); ++i) {
    for (long long j = (i + 1); j <= (n); ++j) {
      vector<long long> cands{i, j};
      for (long long tr = 0; tr < (3); ++tr) {
        cands.push_back(cands.back() + j - i);
      }
      long long bad = 0;
      for (auto x : cands) {
        if (x > n || s[x] == '.') {
          bad = 1;
        }
      }
      if (!bad) {
        cout << "yes\n";
        return 0;
      }
    }
  }
  cout << "no\n";
  return 0;
}
