#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; template class Operators { public: template const T1 operator+(const T2& right) const{ T1 ans = static_cast( *this ); ans += right; return ans; } template const T1 operator-(const T2& right) const{ T1 ans = static_cast( *this ); ans -= right; return ans; } template const T1 operator*(const T2& right) const{ T1 ans = static_cast( *this ); ans *= right; return ans; } template const T1 operator/(const T2& right) const{ T1 ans = static_cast( *this ); ans /= right; return ans; } bool operator!=(const T1& right) const{ const T1& left = static_cast( *this ); return !(left == right); } }; class Mod : public Operators { private: static const int MOD = 1000000009; long long a; public: Mod(){ a = 0; } Mod(long long x){ a = (x % MOD + MOD) % MOD; } Mod& operator+=(const Mod& x){ a = (a + x.a) % MOD; return *this; } Mod& operator-=(const Mod& x){ a = (a - x.a + MOD) % MOD; return *this; } Mod& operator*=(const Mod& x){ a = (a * x.a) % MOD; return *this; } Mod& operator/=(const Mod& x){ // フェルマーの小定理、MODが素数である場合のみ有効 int b = MOD - 2; long long c = x.a; while(b > 0){ if(b & 1){ a *= c; a %= MOD; } c *= c; c %= MOD; b >>= 1; } return *this; } bool operator==(const Mod& x) const{ return a == x.a; } long long getValue(){ return a; } }; int main() { int n, k; cin >> n >> k; vector a(n); for(int i=0; i> a[i]; vector ans(2, 0); for(int i=0; i