function main(input) {
    const params = input.trim().split(/[\n\s]/g);
    let tmp = {};
    params.forEach(param => {
        if (tmp[param]) {
            tmp[param]++;
        } else {
            tmp[param] = 1;
        }
    });
    const res = Object.keys(tmp).every(key => {
        return tmp[key] === 1 || tmp[key] === 2;
    })
    console.log(res ? 'YES' : 'NO');
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));