#include <iostream>
using namespace std;
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 < m01 || num < m02 && num%2==0)
{
if (m02 > m01 && m02>num)
m02 = num;
else
if (m01 > m02 && m01>num)
m01 = num;
}
else
if (num < m11 || num < m12)
{
if (m12 > m11 && m12>num)
m12 = num;
else
if (m11 > m02 && m11>num)
m11 = 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;
}
CiNpbmNsdWRlIDxpb3N0cmVhbT4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpCnsKCWludCBOLCBtMDEgPSAxMDAyLCBtMDIgPSAxMDAzLCBtMTEgPSAxMDAyLCBtMTIgPSAxMDAzLCBudW0sIHJlcywgUjsKCWNpbiA+PiBOOwoJZm9yICg7IE4gPj0xOyAtLU4pCgl7CgkJY2luID4+IG51bTsKCQlpZiAobnVtIDwgbTAxIHx8IG51bSA8IG0wMiAmJiBudW0lMj09MCkKCQl7CgkJCWlmIChtMDIgPiBtMDEgJiYgbTAyPm51bSkKCQkJCW0wMiA9IG51bTsKCQkJZWxzZQoJCQkJaWYgKG0wMSA+IG0wMiAmJiBtMDE+bnVtKQoJCQkJCW0wMSA9IG51bTsKCQl9CgkJZWxzZQoJCQlpZiAobnVtIDwgbTExIHx8IG51bSA8IG0xMikKCQkJewoJCQkJaWYgKG0xMiA+IG0xMSAmJiBtMTI+bnVtKQoJCQkJCW0xMiA9IG51bTsKCQkJCWVsc2UKCQkJCQlpZiAobTExID4gbTAyICYmIG0xMT5udW0pCgkJCQkJCW0xMSA9IG51bTsKCQkJfQoJfQoJY2luID4+IHJlczsKCWlmIChtMDErbTAyPm0xMSttMTIpCgkJUiA9IG0xMSttMTI7CgllbHNlCgkJUiA9IG0wMSttMDI7CgoJY291dCA8PCAiUmVzdWx0OiAiIDw8IFIgPDwgZW5kbDsKCWlmIChSID09IHJlcykKCQljb3V0IDw8ICJZRVMiOwoJZWxzZQoJCWNvdXQgPDwgIk5PIjsKCXN5c3RlbSgicGF1c2U+dm9pZCIpOwoJcmV0dXJuIDA7Cn0=