fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. cin.tie(0);
  6. ios::sync_with_stdio(false);
  7.  
  8. int n, k;
  9. cin >> n >> k;
  10.  
  11. int a, b; bool res = true;
  12. cin >> a;
  13.  
  14. while (a != 0) {
  15. cin >> b;
  16.  
  17. if (b == k) {res = false;}
  18.  
  19. cin >> a;
  20.  
  21. }
  22.  
  23. if (res) {
  24. cout << "Yes";
  25. } else {
  26. cout << "No";
  27. }
  28. return 0;
  29. }
Success #stdin #stdout 0.01s 5308KB
stdin
3 2
2 3
0
stdout
Yes