#include <bits/stdc++.h>
using namespace std;
char str[111];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", str);
  int gh = n / 4;
  for (int i = 1; i <= gh; i++) {
    for (int j = 0; j < n; j++) {
      if (str[j] == '*') {
        if (str[j + i] == '*' and str[j + 2 * i] == '*' and
            str[j + 3 * i] == '*' and str[j + 4 * i] == '*') {
          puts("YES");
          return 0;
        }
      }
    }
  }
  puts("NO");
  return 0;
}
