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.
import java.util.*;

// import javax.tools.DocumentationTool.Location;

// import jdk.internal.net.http.common.Pair;
import java.lang.*;

// import org.graalvm.compiler.graph.spi.Canonicalizable.Binary;

import java.io.*;

public class sol {

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String giveMeFile) throws IOException {
            File file = new File("input.txt");
            br = new BufferedReader(new FileReader(file));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static boolean[] SES() {
        int n = 1000001;
        // SES Stands for SieveOfEratoSthenes
        boolean isPrime[] = new boolean[n + 1];
        Arrays.fill(isPrime, true);

        isPrime[0] = false;
        isPrime[1] = false;
        for (int i = 2; i * i <= n; i++) {
            for (int j = 2 * i; j <= n; j += i) {
                isPrime[j] = false;
            }

        }
        return isPrime;
    }

    public static int gcd(int a, int b) {
        return a % b == 0 ? b : gcd(b, a % b);
    }

    public static long fastPower(int a, int b, int n) {
        int res = 1;
        while (b > 0) {
            if ((b & 1) != 0) {
                res = (res % n * a % n) % n;
            }

            a = (a % n * a % n) % n;
            b = b >> 1; // dividing by 2
        }
        return res;
    }

    public static int first(int arr[], int low, int high, int x, int n) {
        if (high >= low) {
            int mid = low + (high - low) / 2;
            if ((mid == 0 || x > arr[mid - 1]) && arr[mid] == x)
                return mid;
            else if (x > arr[mid])
                return first(arr, (mid + 1), high, x, n);
            else
                return first(arr, low, (mid - 1), x, n);
        }
        return -1;
    }

    public static int last(int arr[], int low, int high, int x, int n) {
        if (high >= low) {
            int mid = low + (high - low) / 2;
            if ((mid == n - 1 || x < arr[mid + 1]) && arr[mid] == x)
                return mid;
            else if (x < arr[mid])
                return last(arr, low, (mid - 1), x, n);
            else
                return last(arr, (mid + 1), high, x, n);
        }
        return -1;
    }

    public static long sumPair(int arr[], int n) {
        long sum = 0;
        for (int i = n - 1; i >= 0; i--)
            sum += i * arr[i] - (n - 1 - i) * arr[i];

        return sum;
    }

    static int SE(int N) {
        // Sieve of eratosthenes method
        int[] arr = new int[N + 1];
        for (int i = 2; i * i <= N; i++) {
            if (arr[i] == 0)
                for (int j = 2 * i; j <= N; j += i)
                    arr[j]++;

            arr[i] = 1;
        }

        int max = arr[0];
        for (int i = 1; i < arr.length; i++)
            if (arr[i] > max)
                max = arr[i];

        return max;

        // Return maximum element in arr[]
        // return getMax(arr);
    }

    public static void main(String[] args) throws IOException {

        // ************** Providing input File
        // File file = new File("input.txt");
        // BufferedReader br = new BufferedReader(new FileReader(file));

        // *************** Input for Online Judges with Buffered Reader
        // BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        // ************* Input for Online Judges with Scanner class
        // Reading with Scanner class
        // Scanner sc = new Scanner(file);
        // sc.useDelimiter("\\Z");

        // ***************** Printing Outout to output file.
        // PrintWriter printWriter = new PrintWriter(new BufferedWriter(new
        // FileWriter("output.txt")));
        // printWriter.println("something here");
        // printWriter.close(); --->> // only this close method will flush the output
        // from the buffer to the output file.

        FastReader read = new FastReader();
            int n = read.nextInt();
            String s = read.next();
            int a[] = new int[s.length()];
            for (int i = 0; i < n; i++)
                a[i] = Character.getNumericValue(s.charAt(i));

            boolean naihai = false;
            // System.out.println(s);
            for (int i = 0; i < s.length(); i++) {
                if (a[i] == 4 || a[i] == 7) {
                    continue;
                } else {
                    naihai = true;
                    break;
                }
            }
            if (naihai) {
                System.out.println("NO");
                // System.out.println("c");
            }

            else {
                int sum = 0;
                for (int i = 0; i < n / 2; i++) {
                    sum += a[i];
                }
                for (int i = n / 2; i < n; i++) {
                    sum -= a[i];
                }

                if (sum == 0) {
                    System.out.println("YES");
                } else
                    System.out.println("NO");

                // System.out.println("sum " + sum);
        }
    }
}