#include <iostream>
using namespace std;
void swap(int& a, int& b, int& c) {
if (a > b) std::swap(a,b);
if (b > c) std::swap(b,c);
}
int main()
{
int N, m01 = 1002, m02 = 1003, m11 = 1002, m12 = 1003, num, res, R;
cin >> N;
for (; N >=1; --N)
{
cin >> num;
if (num%2==0) swap(m01, m02, num);
else swap(m11, m12, num);
}
cin >> res;
if (m01+m02>m11+m12)
R = m11+m12;
else
R = m01+m02;
cout << "Result: " << R << endl;
if (R == res)
cout << "YES";
else
cout << "NO";
system("pause>void");
return 0;
}
CiNpbmNsdWRlIDxpb3N0cmVhbT4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp2b2lkIHN3YXAoaW50JiBhLCBpbnQmIGIsIGludCYgYykgewoJaWYgKGEgPiBiKSBzdGQ6OnN3YXAoYSxiKTsKCWlmIChiID4gYykgc3RkOjpzd2FwKGIsYyk7Cn0KCmludCBtYWluKCkKewoJaW50IE4sIG0wMSA9IDEwMDIsIG0wMiA9IDEwMDMsIG0xMSA9IDEwMDIsIG0xMiA9IDEwMDMsIG51bSwgcmVzLCBSOwoJY2luID4+IE47Cglmb3IgKDsgTiA+PTE7IC0tTikKCXsKCQljaW4gPj4gbnVtOwoJCWlmIChudW0lMj09MCkJc3dhcChtMDEsIG0wMiwgbnVtKTsKCQllbHNlCQkJc3dhcChtMTEsIG0xMiwgbnVtKTsKCX0KCQkJCgljaW4gPj4gcmVzOwoJaWYgKG0wMSttMDI+bTExK20xMikKCQlSID0gbTExK20xMjsKCWVsc2UKCQlSID0gbTAxK20wMjsKCgljb3V0IDw8ICJSZXN1bHQ6ICIgPDwgUiA8PCBlbmRsOwoJaWYgKFIgPT0gcmVzKQoJCWNvdXQgPDwgIllFUyI7CgllbHNlCgkJY291dCA8PCAiTk8iOwoJc3lzdGVtKCJwYXVzZT52b2lkIik7CglyZXR1cm4gMDsKfQ==