#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  string s, a;
  cin >> s;
  bool check = false;
  for (long long i = 0; i < n && !check; i++) {
    if (s[i] == '*') {
      for (long long j = 1; j < 30 && !check; j++) {
        long long now = i + j, local = 0;
        while (now < n && s[now] == '*') {
          now += j;
          local++;
        }
        if (local >= 4) check = true;
      }
    }
  }
  cout << (check ? "YES" : "NO");
}
