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>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long fact(long long j) {
  long long a = 1;
  for (long long i = 1; i <= j; i++) a *= i;
  return a;
}
long long pw(long long a, long long b) {
  if (b == 0) return 1;
  if (b % 2)
    return pw(a, b - 1) * a;
  else {
    long long x = pw(a, b / 2);
    return x * x;
  }
}
long long sum2(long long c) {
  long long s = 0;
  while (c != 0) {
    s += (c % 10) * (c % 10);
    c /= 10;
  }
  return s;
}
vector<int> merge(const vector<int> &a, const vector<int> &b) {
  long long p1 = 0, p2 = 0;
  vector<int> c;
  for (; p1 < a.size() && p2 < b.size();)
    if (a[p1] == b[p2]) {
      c.push_back(a[p1]);
      p1++;
      p2++;
    } else if (a[p1] < b[p2])
      p1++;
    else
      p2++;
  return c;
}
bool prime(long long a) {
  if (a == 0 || a == 1) return false;
  for (int i = 2; i <= sqrt(a); i++)
    if (a % i == 0) return false;
  return true;
}
long long C(long long n, long long k) {
  vector<vector<long long>> dp(n + 1, vector<long long>(n + 1, 1));
  for (int i = 0; i < (n + 1); i++) {
    for (int j = 1; j < i; j++) {
      dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j];
    }
  }
  return dp[n][k];
}
struct st {
  int h, m, s;
};
bool operator<(st A, st B) {
  return (A.h < B.h || A.h == B.h && A.m < B.m ||
          A.h == B.h && A.m == B.m && A.s < B.s);
}
bool cmp(long long a, long long b) {
  if (a % 10 < b % 10) return true;
  if (a % 10 > b % 10) return false;
  if (a % 10 == b % 10) {
    return (a < b);
  }
}
long long phi(long long n) {
  long long ans = n;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) {
      while (n % i == 0) n /= i;
      ans -= ans / i;
    }
  if (n > 1) ans -= ans / n;
  return ans;
}
vector<long long> rech(200005, 1);
void reh() {
  rech[0] = 0;
  rech[1] = 0;
  for (long long i = 2; i < 100000; i++)
    for (long long j = i * i; j < 100000; j += i)
      if (rech[j]) rech[j] = 0;
}
struct Node {
  long long i, mx;
};
Node tr[4 * 1000000 + 10];
void build(vector<long long> &a, long long v, long long l, long long r) {
  if (l == r)
    tr[v].i = l, tr[v].mx = a[l];
  else {
    long long m = (l + r) / 2;
    build(a, 2 * v, l, m);
    build(a, 2 * v + 1, m + 1, r);
    if (tr[2 * v].mx >= tr[2 * v + 1].mx)
      tr[v].i = tr[2 * v].i, tr[v].mx = tr[2 * v].mx;
    else
      tr[v].i = tr[2 * v + 1].i, tr[v].mx = tr[2 * v + 1].mx;
  }
}
Node find(long long x, long long y, long long v, long long l, long long r) {
  if (x == l && y == r) return tr[v];
  long long m = (l + r) / 2;
  if (y <= m)
    return find(x, y, 2 * v, l, m);
  else if (x > m)
    return find(x, y, 2 * v + 1, m + 1, r);
  else {
    Node a, b, c;
    a = find(x, m, 2 * v, l, m);
    b = find(m + 1, y, 2 * v + 1, m + 1, r);
    if (a.mx >= b.mx)
      c.i = a.i, c.mx = a.mx;
    else
      c.i = b.i, c.mx = b.mx;
    return c;
  }
}
void update(long long i, long long x, long long v, long long l, long long r) {
  if (l == r) {
    if (tr[v].mx != 0)
      tr[v].mx = x;
    else
      return;
  } else {
    long long m = (l + r) / 2;
    if (i <= m)
      update(i, x, 2 * v, l, m);
    else
      update(i, x, 2 * v + 1, m + 1, r);
    if (tr[2 * v].mx >= tr[2 * v + 1].mx)
      tr[v].i = tr[2 * v].i, tr[v].mx = tr[2 * v].mx;
    else
      tr[v].i = tr[2 * v + 1].i, tr[v].mx = tr[2 * v + 1].mx;
  }
}
vector<long long> u(100001, 0);
void way(long long x, long long n, vector<vector<long long>> &a, long long &l,
         long long &k) {
  long long s = 0;
  for (int i = 1; i <= n; i++)
    if (a[x][i] && !u[i]) {
      l++;
      s++;
      u[i] = 1;
      way(i, n, a, l, k);
      u[i] = 0;
    }
  if (!s) k++;
}
string dectobin(long long n) {
  string s;
  while (n) {
    s += n % 2 + '0';
    n /= 2;
  }
  reverse(s.begin(), s.end());
  return s;
}
long long bintodec(string s) {
  long long n = 0;
  for (int i = 0; i < s.length(); i++) {
    n += (s[i] - '0') * pw(2, s.length() - i - 1);
  }
  return n;
}
long long tree[1000000];
void bt(vector<long long> &a, long long l, long long r, long long v) {
  if (l == r)
    tree[v] = a[l];
  else {
    long long m = (l + r) / 2;
    bt(a, l, m, 2 * v);
    bt(a, m + 1, r, 2 * v + 1);
    tree[v] = max(tree[2 * v], tree[2 * v + 1]);
  }
}
long long fit(long long x, long long y, long long l, long long r, long long v) {
  if (x == l && y == r) return tree[v];
  long long m = (l + r) / 2;
  if (y <= m)
    return fit(x, y, l, m, 2 * v);
  else if (x > m)
    return fit(x, y, m + 1, r, 2 * v + 1);
  else
    return max(fit(x, m, l, m, 2 * v), fit(m + 1, y, m + 1, r, 2 * v + 1));
}
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long s1 = 0, s2 = 0;
  for (int i = 0; i < (n / 2); i++) {
    s1 += s[i] - '0';
    s2 += s[n - i - 1] - '0';
    if (s[i] != '4' && s[i] != '7' ||
        s[n - i - 1] != '4' && s[n - i - 1] != '7') {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (s1 == s2)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
