#include <bits/stdc++.h>
using namespace std;
string s;
int n;
int main() {
  cin >> n >> s;
  for (int i = 0; i < n; i++)
    if (s[i] == '*')
      for (int j = i + 1; j + 3 * (j - i) < n; j++)
        if (s[j] == '*' && s[j + (j - i)] == '*' && s[j + 2 * (j - i)] == '*' &&
            s[j + 3 * (j - i)] == '*') {
          cout << "YES" << endl;
          return 0;
        }
  cout << "NO" << endl;
  return 0;
}
