#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = ({
    int x;
    scanf("%d", &x);
    x;
  });
  string s;
  cin >> s;
  string ans = "no";
  for (int d = (1); d < (30); d += (1)) {
    for (int i = (0); i < (n); i += (1)) {
      int g = 1;
      for (int j = (0); j < (5); j += (1)) {
        if (i + j * d >= n || s[i + j * d] == '.') {
          g = 0;
        }
      }
      if (g) {
        ans = "yes";
        break;
      }
    }
  }
  cout << ans << endl;
}
