#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  for (long long ini = 0; ini < n; ini++) {
    for (long long salto = 1; salto < n; salto++) {
      bool ok = true;
      for (long long cnt = 0; cnt < 5; cnt++) {
        long long pos = ini + salto * cnt;
        if (pos >= n || s[pos] == '.') {
          ok = false;
          break;
        }
      }
      if (ok) {
        cout << "yes" << endl;
        return 0;
      }
    }
  }
  cout << "no" << endl;
  return 0;
}
