#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma GCC optimize("Ofast") #include #include using namespace std; #if __has_include() #include using namespace atcoder; #endif using ll = long long; using ld = long double; using ull = long long; #define endl "\n" #define REP3(i, m, n) for (int i = (m); (i) < int(n); ++ (i)) #define rep(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define ALL(x) begin(x), end(x) #define all(s) (s).begin(),(s).end() //#define rep2(i, m, n) for (int i = (m); i < (n); ++i) //#define rep(i, n) rep2(i, 0, n) #define PB push_back #define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i) #define drep(i, n) drep2(i, n, 0) #define rever(vec) reverse(vec.begin(), vec.end()) #define sor(vec) sort(vec.begin(), vec.end()) #define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++) #define fi first #define se second #define pb push_back #define P pair //const ll mod = 998244353; const ll mod = 1000000007; const ll inf = 4500000000000000000ll; static const long double pi = 3.141592653589793; templatevoid vcin(vector &n){for(int i=0;i>n[i];} templatevoid vcin(vector &n,vector &m){for(int i=0;i>n[i]>>m[i];} templatevoid vcout(vector &n){for(int i=0;ivoid vcin(vector> &n){for(int i=0;i>n[i][j];}}} templatevoid vcout(vector> &n){for(int i=0;iauto min(const T& a){ return *min_element(all(a)); } templateauto max(const T& a){ return *max_element(all(a)); } templatevoid print(pair a){cout<bool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b void ifmin(T t,T u){if(t>u){cout<<-1< void ifmax(T t,T u){if(t>u){cout<<-1<auto make_vector(T x,int arg,Args ...args){if constexpr(sizeof...(args)==0)return vector(arg,x);else return vector(arg,make_vector(x,args...));} ll modPow(ll a, ll n, ll mod) { ll ret = 1; ll p = a % mod; while (n) { if (n & 1) ret = ret * p % mod; p = p * p % mod; n >>= 1; } return ret; } vector divisor(ll x){ vector ans; for(ll i = 1; i * i <= x; i++){ if(x % i == 0) {ans.push_back(i); if(i*i!=x){ ans.push_back(x / ans[i]);}}}sor(ans); return ans; } template struct Sum{ vector data; Sum(const vector& v):data(v.size()+1){ for(ll i=0;i struct Sum2{ vector> data; Sum2(const vector> &v):data(v.size()+1,vector(v[0].size()+1)){ for(int i=0;i struct Matrix { vector > val; Matrix(int n, int m, T x = 0) : val(n, vector(m, x)) {} void init(int n, int m, T x = 0) {val.assign(n, vector(m, x));} size_t size() const {return val.size();} inline vector& operator [] (int i) {return val[i];} }; template int GaussJordan(Matrix &A, bool is_extended = false) { int m = A.size(), n = A[0].size(); int rank = 0; for (int col = 0; col < n; ++col) { // 拡大係数行列の場合は最後の列は掃き出ししない if (is_extended && col == n-1) break; // ピボットを探す int pivot = -1; T ma = EPS; for (int row = rank; row < m; ++row) { if (abs(A[row][col]) > ma) { ma = abs(A[row][col]); pivot = row; } } // ピボットがなかったら次の列へ if (pivot == -1) continue; // まずは行を swap swap(A[pivot], A[rank]); // ピボットの値を 1 にする auto fac = A[rank][col]; for (int col2 = 0; col2 < n; ++col2) A[rank][col2] /= fac; // ピボットのある列の値がすべて 0 になるように掃き出す for (int row = 0; row < m; ++row) { if (row != rank && abs(A[row][col]) > EPS) { auto fac = A[row][col]; for (int col2 = 0; col2 < n; ++col2) { A[row][col2] -= A[rank][col2] * fac; } } } ++rank; } return rank; } template vector linear_equation(Matrix A, vector b) { // extended int m = A.size(), n = A[0].size(); Matrix M(m, n + 1); for (int i = 0; i < m; ++i) { for (int j = 0; j < n; ++j) M[i][j] = A[i][j]; M[i][n] = b[i]; } int rank = GaussJordan(M, true); // check if it has no solution vector res; for (int row = rank; row < m; ++row) if (abs(M[row][n]) > EPS) return res; // answer res.assign(n, 0); for (int i = 0; i < rank; ++i) res[i] = M[i][n]; return res; } int main() { cincout(); ll n,l; cin>>n>>l; Matrix a(2*n,2*n); vector d(n); vcin(d); // for(int i=0;i b; for(int i=0;i k(2*n); vcin(k); // for(int i=0;i<2*n;i++) k[i]=1; auto f=linear_equation(a,k); if(f.size()==0){ cout<<"No"<=0.0&&abs(f[i]-int(f[i]))<=EPS){ } else{ cout<<"No"<