According to rules of the Berland fashion, a jacket should be fastened by all the buttons except only one, but not necessarily it should be the last one. Also if the jacket has only one button, it should be fastened, so the jacket will not swinging open.

You are given a jacket with n buttons. Determine if it is fastened in a right way.

Input

The first line contains integer n (1 ≤ n ≤ 1000) — the number of buttons on the jacket.

The second line contains n integers ai (0 ≤ ai ≤ 1). The number ai = 0 if the i-th button is not fastened. Otherwise ai = 1.

Output

In the only line print the word "YES" if the jacket is fastened in a right way. Otherwise print the word "NO".

Examples

Input

3
1 0 1


Output

YES


Input

3
1 0 0


Output

NO
/*
 * The MIT License
 *
 * Copyright 2016 Mouad NACIRI <mouadnaciri1@gmail.com>.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintStream;
import java.math.BigDecimal;
import java.util.*;

/**
 *
 * @author NACIRI Mouad <mouadnaciri1@gmail.com>
 * @version 1.5.2
 */

public class CF {
    /* VIP, DON'T TOUCH!! */
    static StringTokenizer ST;
    static BufferedReader IN;
    static PrintStream o, e;
    static {
        IN = new BufferedReader(new InputStreamReader(System.in));
        o = System.out;
        e = System.err;
    }
    /*
    int   2_147_483_647               /  -2_147_483_648
    long  9_223_372_036_854_775_807L  /  -9_223_372_036_854_775_808L
    */
    
    public static void main(String[] ag) throws IOException {
        int n = ni(), i = n, sum = 0;
        while(i-- > 0) { sum += ni(); }
        //dg(n, sum);
        o.println((n == 1 && sum == 1) || (n != 1 && n - 1 == sum) ? "YES" : "NO");
        cAll();
    }
    
    static <Var> void dg(Var... vars) { for(Var obj : vars) { e.print(obj + " "); } e.println(); }
    
    //IO stuff...   
    static void ll() { ST = new StringTokenizer(nlnt()); }
    static void ll(String del) { ST = new StringTokenizer(nlnt(), del); }
    static void ll(String s, String del) { ST = new StringTokenizer(s, del); }
    static void lll(String s) { ST = new StringTokenizer(s); }
    
    static int tlen() { return ST == null ? 0 : ST.countTokens(); }
    static boolean hn() { return ST != null && ST.hasMoreTokens(); }
    static String n() {
        if(!hn()) { ll(); }
        return ST.nextToken();
    }
    static String nln() {
        String l = null;
        try {
            while((l = IN.readLine()) != null && l.trim().length() == 0) {}
        } catch(IOException e) { }
        ST = null;
        return l;
    }
    static String nlnt() {
        String l = null;
        try {
            while((l = IN.readLine()) != null && (l = l.trim()).length() == 0) {}
        } catch(IOException e) { }
        ST = null;
        return l;
    }
    static boolean nbl() { return Boolean.parseBoolean(n()); }
    static byte nb() { return Byte.parseByte(n()); }
    static byte nb(int radix) { return Byte.parseByte(n(), radix); }
    static double nd() { return Double.parseDouble(n()); }
    static float nf() { return Float.parseFloat(n()); }
    static int ni() { return Integer.parseInt(n()); }
    static int ni(int radix) { return Integer.parseInt(n(), radix); }
    static long nl() { return Long.parseLong(n()); }
    static long nl(int radix) { return Long.parseLong(n(), radix); }
    static short ns() { return Short.parseShort(n()); }
    static short ns(int radix) { return Short.parseShort(n(), radix); }
    
    static void cAll() throws IOException { IN.close(); }
}