#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  int n;
  while (cin >> n >> str) {
    bool flag = 0;
    for (int i = 0; i < (str.size()); ++i) {
      if (str[i] == '.') continue;
      for (int k = 1; i + k * 4 < str.size(); ++k) {
        bool tmp = 1;
        for (int j = (1); j <= (4); ++j)
          if (str[i + j * k] == '.') tmp = 0;
        if (tmp) {
          flag = 1;
          break;
        }
      }
      if (flag) break;
    }
    if (flag)
      puts("yes");
    else
      puts("no");
  }
  return 0;
}
