Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.

Petya loves tickets very much. As we know, each ticket has a number that is a positive integer. Its length equals n (n is always even). Petya calls a ticket lucky if the ticket's number is a lucky number and the sum of digits in the first half (the sum of the first n / 2 digits) equals the sum of digits in the second half (the sum of the last n / 2 digits). Check if the given ticket is lucky.

Input

The first line contains an even integer n (2 ≤ n ≤ 50) — the length of the ticket number that needs to be checked. The second line contains an integer whose length equals exactly n — the ticket number. The number may contain leading zeros.

Output

On the first line print "YES" if the given ticket number is lucky. Otherwise, print "NO" (without the quotes).

Examples

Input

2
47


Output

NO


Input

4
4738


Output

NO


Input

4
4774


Output

YES

Note

In the first sample the sum of digits in the first half does not equal the sum of digits in the second half (4 ≠ 7).

In the second sample the ticket number is not the lucky number.
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
template <typename T>
inline int mid(T &a, T &b) {
  return (a + b) / 2;
}
template <typename T>
inline int lchild(T &a) {
  return (2 * a);
}
template <typename T>
inline int rchild(T &a) {
  return (2 * a + 1);
}
template <typename T>
inline int parent(T &a) {
  return a / 2;
}
vector<bool> primes(100000, true);
void seive(int n) {
  primes[0] = primes[1] = false;
  for (int i = 4; i < n; i += 2) primes[i] = false;
  for (int i = 3; i * i <= n; i += 2) {
    if (primes[i])
      for (int j = i * i; j < n; j += i) primes[j] = false;
  }
}
ll binexp(ll a, ll b, ll mod = 1e9 + 7) {
  if (b == 0) return 1;
  ll sem = binexp(a, b / 2, mod);
  if (b & 1)
    return (a * (sem * sem) % mod) % mod;
  else
    return (sem * sem) % mod;
}
int find(int a, vi &parents) {
  if (a == parents[a]) {
    return a;
  }
  vi childs;
  while (a != parents[a]) {
    childs.push_back(a);
    a = parents[a];
  }
  for (int i = 0; i < childs.size(); ++i) parents[childs[i]] = a;
  return a;
}
void unionf(int a, int b, vi &parents, vi &ranks) {
  a = find(a, parents);
  b = find(b, parents);
  if (a == b)
    return;
  else {
    if (ranks[a] < ranks[b]) {
      parents[a] = b;
    } else if (ranks[b] < ranks[a]) {
      parents[b] = a;
    } else {
      parents[a] = b;
      ranks[b]++;
    }
  }
}
typedef struct {
  int x, y;
} point;
typedef struct {
  int start;
  int end;
  int weight;
} Edge;
struct Node {
  int data;
  struct Node *left, *right;
  Node(int data) {
    this->data = data;
    left = right = NULL;
  }
};
const int N = 1e5 + 5;
int segtree[4 * N];
int build(int i, int l, int r, int arr[]) {
  if (l == r) {
    segtree[i] = arr[l];
    return segtree[i];
  }
  segtree[i] = build(lchild(i), l, mid(l, r), arr) +
               build(rchild(i), mid(l, r) + 1, r, arr);
  return segtree[i];
}
void update(int i, int tl, int tr, int ind, int val) {
  if (tl == ind && tr == ind) {
    segtree[i] = val;
    return;
  }
  if (ind > tr || ind < tl) {
    return;
  }
  int tm = mid(tl, tr);
  update(lchild(i), tl, tm, ind, val);
  update(rchild(i), tm + 1, tr, ind, val);
  segtree[i] = segtree[lchild(i)] + segtree[rchild(i)];
}
int query(int i, int tl, int tr, int l, int r) {
  if (tl > r || tr < l) return 0;
  if (l <= tl && tr <= r) return segtree[i];
  int tm = mid(tl, tr);
  int ans = 0;
  ans += query(lchild(i), tl, tm, l, r);
  ans += query(rchild(i), tm + 1, tr, l, r);
  return ans;
}
void solve() {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int k = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] != '4' and s[i] != '7') {
      cout << "NO" << endl;
      return 0;
    } else if (i < n / 2) {
      k += s[i];
    } else {
      k -= s[i];
    }
  }
  cout << (k == 0 ? "YES" : "NO") << endl;
}
