123
user_8384735
c_cpp
3 years ago
264 B
12
Indexable
#include<iostream>
using namespace std;
int n, l, x;
int main(){
cin >> n >> l;
int _2 = l / 2 + (l & 1);
while (n--){
cin >> x;
if (x == 1) _2 -= _2 > 0;
else if (x == 2 && _2 >= 2) _2 -= 2;
else _2--;
}
cout << (_2 < 0 ? "No": "Yes");
}Editor is loading...