    #include<bits/stdc++.h>
    using namespace std;
    #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    int main()
    {
        IOS;
        long long a,b,c,d,e,g,h,n,t,f,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,arr1[100],arr[200001],sum=0,sum1=0,ma=0,mi=10000000001;
        long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0;
        double pi=2 * acos (0.0);
        string str,str1,str2,str3;
        char ch;

        vector<long long>v;
        vector<long long>v1;
        vector<string>vs;
        vector<string>vs1;
        map<string,string>mp;
        set<long long>s;
        set<long long>s1;
        set<long long>::iterator it;
        set<long long>::iterator it1;
        //map<string,string>::iterator it;
       // vector< pair<int,int > > v;
        int x[]={1,-1,1,-1,2,2,-2,-2};
        int y[]={2,2,-2,-2,1,-1,1,-1};
        cin>>a>>b;
        for(int i=0; i<a; i++)
        {
            cin>>c;
            v.push_back(c);
        }
        for(int i=1; ;i++)
        {
            sum=((i*(i+1))/2);
            //cout<<sum<<endl;
            if(sum>=b)
            {
                d=i-1;
                break;
            }
        }
        //cout<<d<<endl;
        e=(d*(d+1))/2;
       // cout<<e<<endl;
        f=b-e;
        cout<<v[f-1]<<endl;
        return 0;
    }


    #include<bits/stdc++.h>
    using namespace std;
    #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    int main()
    {
        IOS;
        long long a,b,c,d,e,g,h,n,t,f,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,arr1[100],arr[200001],sum=0,sum1=0,ma=0,mi=10000000001;
        long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0;
        double pi=2 * acos (0.0);
        string str,str1,str2,str3;
        char ch;

        vector<long long>v;
        vector<long long>v1;
        vector<string>vs;
        vector<string>vs1;
        map<string,string>mp;
        set<long long>s;
        set<long long>s1;
        set<long long>::iterator it;
        set<long long>::iterator it1;
        //map<string,string>::iterator it;
       // vector< pair<int,int > > v;
        int x[]={1,-1,1,-1,2,2,-2,-2};
        int y[]={2,2,-2,-2,1,-1,1,-1};
        cin>>a>>b;
        for(int i=0; i<a; i++)
        {
            cin>>c;
            v.push_back(c);
        }
        for(int i=1; ;i++)
        {
            sum=sum+((i*(i+1))/2);
            //cout<<sum<<endl;
            if(sum==b)
            {
                cout<<v[0]<<endl;
                return 0;
            }
            if(sum>b)
            {
                d=i-1;
                break;
            }
        }
        //cout<<d<<endl;
        e=(d*(d+1))/2;
       // cout<<e<<endl;
        f=b-e;
        cout<<v[f-1]<<endl;
        return 0;
    }


    #include<bits/stdc++.h>
    using namespace std;
    #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    int main()
    {
        IOS;
        long long a,b,c,d,e,g,h,n,t,f,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,arr1[100],arr[200001],sum=0,sum1=0,ma=0,mi=10000000001;
        long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0;
        double pi=2 * acos (0.0);
        string str,str1,str2,str3;
        char ch;

        vector<long long>v;
        vector<long long>v1;
        vector<string>vs;
        vector<string>vs1;
        map<string,string>mp;
        set<long long>s;
        set<long long>s1;
        set<long long>::iterator it;
        set<long long>::iterator it1;
        //map<string,string>::iterator it;
       // vector< pair<int,int > > v;
        int x[]={1,-1,1,-1,2,2,-2,-2};
        int y[]={2,2,-2,-2,1,-1,1,-1};
        cin>>a>>b;
        for(int i=0; i<a; i++)
        {
            cin>>c;
            v.push_back(c);
        }
        for(int i=1; ;i++)
        {
            sum=sum+((i*(i+1))/2);
            //cout<<sum<<endl;
            if(sum==b)
            {
                d=i;
                break;
            }
            if(sum>b)
            {
                d=i-1;
                break;
            }
        }
        if(sum==b)
        {
            cout<<v[d-2]<<endl;
            return 0;
        }
        e=(d*(d+1))/2;
        f=b-e;
        cout<<v[f-1]<<endl;
        return 0;
    }


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k,i,f,s;
    cin>>n>>k;
    int a[k];
    for(i=0;i<k;i++)
    cin>>a[i];
    for(i=1;i<n;i++)
    {
     f=i*(i+1)/2;
     s=(i+1)*(i+2)/2;
     if(k>=f && k<=s)
     break;
    }
    k=k-f;
    cout<<a[k-1];
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k,i,f=0,s=0;
    cin>>n>>k;
    int a[k];
    for(i=0;i<k;i++)
    cin>>a[i];
    for(i=1;i<n;i++)
    {
     f=i*(i+1)/2;
     s=(i+1)*(i+2)/2;
     if(k>=f && k<=s)
     break;
    }
    k=k-f;
    cout<<a[k-1];
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,k,i,f=0,s=0;
    cin>>n>>k;
    long long int a[n];
    for(i=0;i<n;i++)
    cin>>a[i];
    for(i=1;i<n;i++)
    {
     f=i*(i+1)/2;
     s=(i+1)*(i+2)/2;
     if(k>=f && k<=s)
     break;
    }
    k=k-f;
    if(k==0)
    cout<<a[k];
    else
    cout<<a[k-1];
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long n,k,i,f=0,s=0;
    cin>>n>>k;
    long a[n];
    for(i=0;i<n;i++)
    cin>>a[i];
    for(i=1;i<n;i++)
    {
     f=i*(i+1)/2;
     s=(i+1)*(i+2)/2;
     if(k>=f && k<=s)
     break;
    }
    k=k-f;
    if(k==0)
    cout<<a[k];
    else
    cout<<a[k-1];
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k,i,f=0,s=0;
    cin>>n>>k;
    int a[n];
    for(i=0;i<n;i++)
    cin>>a[i];
    for(i=1;i<n;i++)
    {
     f=i*(i+1)/2;
     s=(i+1)*(i+2)/2;
     if(k>=f && k<=s)
     break;
    }
    k=k-f;
    if(k==0)
    cout<<a[k];
    else
    cout<<a[k-1];
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main ()
{
    int n;
    ll k;

    cin >> n >> k;

    int arr[n];
    for(int i=0; i<n; i++)
        cin >> arr[i];

    ll x = ((-1+sqrt(1+8*k))/2), z;
    z = x * (x + 1) / 2;

    if(k == z){
        ll y = z - x * (x - 1) / 2;
        cout<<arr[y-1];
    }
    else
        cout << arr[k-z-1];

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main ()
{
    int n;
    ll k;

    cin >> n >> k;

    int arr[n];
    for(int i=0; i<n; i++)
        cin >> arr[i];

    ll x = ((-1+sqrt(1+8*k))/2);
    x = k - x * (x + 1) / 2;

    if(x == 0)
        cout<<arr[n-1];
    else
        cout << arr[x-1];

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main ()
{
    int n;
    ll k;

    cin >> n >> k;

    int arr[n];
    for(int i=0; i<n; i++)
        cin >> arr[i];

    ll x = ((-1+sqrt(1+8*k))/2);
    x = k - x * (x + 1) / 2;

    cout << arr[x-1];

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main ()
{
    int n;
    ll k;

    cin >> n >> k;

    int arr[n];
    for(int i=0; i<n; i++)
        cin >> arr[i];

    ll x = ((-1+sqrt(1+8*k))/2);
    x = k - x * (x + 1) / 2;

    if(x == 0)
        cout<<arr[x];
    else
        cout << arr[x-1];

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long n,k,co=0;cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)cin>>arr[i];
   long long i=k,op=0;
   //while(i*(i--)/2>=k);
   co=(sqrt(2*k))*(sqrt(2*k)-1)/2;
   cout<<arr[k-co-1]<<endl;
   return 0;
}
/*
4 5
10 4 18 3

*/


#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long n,k,co=0;cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)cin>>arr[i];
   long long i=k;
   //while(i*(i--)/2>=k);
   co=(k/2)*(k/2+1)/2;
   cout<<arr[k-co-1]<<endl;
   return 0;
}
/*
4 5
10 4 18 3

*/


#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long n,k,co=0;cin>>n>>k;
   int arr[n];
   k;
   for(int i=0;i<n;i++)cin>>arr[i];
   int i;
   for(i=1;co<k;i++){
    co+=i*(i+1)/2;
   }
   i--;
   cout<<arr[k==i?0:k-i-1]<<endl;
   return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long n,k,co=0;cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)cin>>arr[i];
   int i=1;
   while(i*(i++)/2<k);
   co=(i-1)*(i-2)/2;
   cout<<arr[k-co-1]<<endl;
   return 0;
}
/*
3 3
6 7 8
6 6 7 6 7 8
i= 2
*/


#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long n,k,co=0;cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)cin>>arr[i];
   long long i=1;
   while(i*(i++)/2<k);
   co=(i-1)*(i-2)/2;
   cout<<arr[k-co-1]<<endl;
   return 0;
}
/*
4 5
10 4 18 3

*/


#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long n,k,co=0;cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)cin>>arr[i];
   long long i=k;
   while(i*(i--)/2>=k);
   co=(i)*(i+1)/2;
   cout<<arr[k-co-1]<<endl;
   return 0;
}
/*
4 5
10 4 18 3

*/


#include<bits/stdc++.h>
#define Ceil(a,b)              ((a)+(b)-1)/(b)
#define MrGAFs                 file();
#define allr(v)                ((v).rbegin()), ((v).rend())
#define all(v)                 ((v).begin()), ((v).end())
#define endl                   "\n"
const int oo = INT_MAX;
const long long  OO = LLONG_MAX;
using namespace std;
int dx[] = { 0, 1, 0, -1, 1, 1, -1, -1 };
int dy[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
int dx1[] = { -1, 1, 0, 0 };
int dy1[] = { 0, 0, -1, 1 };

//functions

void file (){
  ios_base::sync_with_stdio (false);
  cout.tie (NULL);
  cin.tie (NULL);
}

//main function
int main(){
  MrGAFs
    int n, k ;
  cin >> n >> k ;
  vector < int > v (n);
  for (int i = 0 ; i < n ; ++ i)cin >> v[i] ;
  int x = (-1+sqrt(1+8*n))/ 2 , tmp = k - (( x*(x+1) ) /2);
  cout << v[tmp-1];

}


#include<bits/stdc++.h>
#define Ceil(a,b)              ((a)+(b)-1)/(b)
#define MrGAFs                 file();
#define allr(v)                ((v).rbegin()), ((v).rend())
#define all(v)                 ((v).begin()), ((v).end())
#define endl                   "\n"
const int oo = INT_MAX;
const long long  OO = LLONG_MAX;
using namespace std;
int dx[] = { 0, 1, 0, -1, 1, 1, -1, -1 };
int dy[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
int dx1[] = { -1, 1, 0, 0 };
int dy1[] = { 0, 0, -1, 1 };

//functions

void file (){
  ios_base::sync_with_stdio (false);
  cout.tie (NULL);
  cin.tie (NULL);
}

//main function
int main(){
  MrGAFs
    long long  n, k ;
  cin >> n >> k ;
  vector < long long  > v (n);
  for (int i = 0 ; i < n ; ++ i)cin >> v[i] ;
  long long  x = (-1+sqrt(1+8*n))/ 2 , tmp = k - (( x*(x+1) ) /2);
  if(tmp == 0 )tmp=x ;
  cout << v[tmp-1];

}


#include<bits/stdc++.h>
#define Ceil(a,b)              ((a)+(b)-1)/(b)
#define MrGAFs                 file();
#define allr(v)                ((v).rbegin()), ((v).rend())
#define all(v)                 ((v).begin()), ((v).end())
#define endl                   "\n"
const int oo = INT_MAX;
const long long  OO = LLONG_MAX;
using namespace std;
int dx[] = { 0, 1, 0, -1, 1, 1, -1, -1 };
int dy[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
int dx1[] = { -1, 1, 0, 0 };
int dy1[] = { 0, 0, -1, 1 };

//functions

void file (){
  ios_base::sync_with_stdio (false);
  cout.tie (NULL);
  cin.tie (NULL);
}

//main function
int main(){
  MrGAFs
    long long  n, k ;
  cin >> n >> k ;
  vector < long long  > v (n);
  for (int i = 0 ; i < n ; ++ i)cin >> v[i] ;
  long long  x = (-1+sqrt(1+8*n))/ 2 , tmp = k - (( x*(x+1) ) /2);
  cout << v[tmp-1];

}


#include<bits/stdc++.h>
#define Ceil(a,b)              ((a)+(b)-1)/(b)
#define MrGAFs                 file();
#define allr(v)                ((v).rbegin()), ((v).rend())
#define all(v)                 ((v).begin()), ((v).end())
#define endl                   "\n"
const int oo = INT_MAX;
const long long  OO = LLONG_MAX;
using namespace std;
int dx[] = { 0, 1, 0, -1, 1, 1, -1, -1 };
int dy[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
int dx1[] = { -1, 1, 0, 0 };
int dy1[] = { 0, 0, -1, 1 };

//functions

void file (){
  ios_base::sync_with_stdio (false);
  cout.tie (NULL);
  cin.tie (NULL);
}

//main function
int main(){
  MrGAFs
    long long  n, k ;
  cin >> n >> k ;
  vector < long long  > v (n);
  for (int i = 0 ; i < n ; ++ i)cin >> v[i] ;
  long long  x = (-1+sqrt(1+8*k))/ 2 , tmp = k - (( x*(x+1) ) /2);
  if (tmp == 0 )tmp = x;
  cout << v[tmp-1];

}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lli ;
#define f first
#define  s second
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define sc(n) int n; scanf("%d",&n);
#define mod 1000000007
#define MX 1000000001
#define log(n) (int)log2(n)
#define logg(a)(b) log(b)/log(a)
#define pb(x) push_back(x);
#define T int t, q=0; scanf("%d", &t); while(q++<t)
#define pi acos(-1)
#define flag bool fl=true;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
void solve()
{
   vector<int>v1,v2;
   int n,k;
   cin>>n>>k;
   for(int i=0; i<n; i++)
   {
       int x;
       cin>>x;
       v1.pb(x);
       for(int j=0; j<v1.size(); j++)
       {
           v2.pb(v1[j]);
       }
       if(v2.size()>=k)
       {
           cout<<v2[k-1]<<endl;
           return;
       } else
       {
           k=k-(v2.size());
           v2.clear();
       }
   }
   //cout<<v2[k-1]<<endl;

}
int main()
{
    solve();

}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lli ;
#define f first
#define  s second
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define sc(n) int n; scanf("%d",&n);
#define mod 1000000007
#define MX 1000000001
#define log(n) (int)log2(n)
#define logg(a)(b) log(b)/log(a)
#define pb(x) push_back(x);
#define T int t, q=0; scanf("%d", &t); while(q++<t)
#define pi acos(-1)
#define flag bool fl=true;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
void solve()
{
   vector<int>v1,v2;
   int n,k;
   cin>>n>>k;
   for(int i=0; i<n; i++)
   {
       int x;
       cin>>x;
       v1.pb(x);

   }
   ll int m=(n*(n+1))/2;

   cout<<v1[m/k-1]<<endl;

}
int main()
{
    solve();

}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lli ;
#define f first
#define  s second
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define sc(n) int n; scanf("%d",&n);
#define mod 1000000007
#define MX 1000000001
#define log(n) (int)log2(n)
#define logg(a)(b) log(b)/log(a)
#define pb(x) push_back(x);
#define T int t, q=0; scanf("%d", &t); while(q++<t)
#define pi acos(-1)
#define flag bool fl=true;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
int ReturnN(ll int m)
{
    int n=0, m1=0,m2=0;
    m1=(-1 +sqrt(1+(4*2*m)))/2;
    m2=(-1-sqrt(1+(4*2*m)))/2;
    //n=max(m1,m2);
    return m1;

}
void solve()
{
   vector<int>v1;
   int n,k;
   cin>>n>>k;
   vector<ll int >v2;
   ll int m=(n*(n+1))/2;
   int c=1;
   for(int i=0; i<n; i++)
   {
       int x;
       cin>>x;
       v1.pb(x);
        v2.pb(c);
        c++;

   }
   ll int sum=0;
   for(int i=0; i<n; i++)
   {
       sum+=v2[i];
      if(sum>=k)
      {
          int xx=ReturnN(sum);
          int mm=sum-k;
          cout<<v1[(xx-mm)-1]<<endl;
          return;

      }
   }

}
int main()
{
   // cout<<ReturnN(10)<<endl;
    solve();

}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lli ;
#define f first
#define  s second
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define sc(n) int n; scanf("%d",&n);
#define mod 1000000007
#define MX 1000000001
#define log(n) (int)log2(n)
#define logg(a)(b) log(b)/log(a)
#define pb(x) push_back(x);
#define T int t, q=0; scanf("%d", &t); while(q++<t)
#define pi acos(-1)
#define flag bool fl=true;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);

void solve()
{
   vector<int>v1;
   int n,k;
   cin>>n>>k;
   vector<ll int >v2;
   ll int m=(n*(n+1))/2;
   int c=0,d=0;
   ll int sum=0;
   int index=0;
   bool f=false;
   for(int i=1; i<=n; i++)
   {
       int  x;
       cin>>x;
       v1.pb(x);
       if(f)
       {
           continue;
       }
       c++;
       sum+=(c);
     //  d++;
       if(sum>=k)
       {
           int xx=sum-k;
           index=i-xx;
           f=true;
        //cout<<sum<<endl;
       }

   }
   cout<<v1[index-1]<<endl;

}
int main()
{
   // cout<<ReturnN(10)<<endl;
   fast;
    solve();

}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lli ;
#define f first
#define  s second
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define sc(n) int n; scanf("%d",&n);
#define mod 1000000007
#define MX 1000000001
#define log(n) (int)log2(n)
#define logg(a)(b) log(b)/log(a)
#define pb(x) push_back(x);
#define T int t, q=0; scanf("%d", &t); while(q++<t)
#define pi acos(-1)
#define flag bool fl=true;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
void solve()
{
   vector<int>v1,v2;
   int n,k;
   cin>>n>>k;
   for(int i=0; i<n; i++)
   {
       int x;
       cin>>x;
       v1.pb(x);
       for(int j=0; j<v1.size(); j++)
       {
           v2.pb(v1[j]);
       }
   }
   cout<<v2[k-1]<<endl;

}
int main()
{
    solve();

}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

	long long int n , k  , i , j    ; cin >> n >> k ;
	vector <long long int> Big;
	int arr[n+5];

	for (i = 0 ; i < n ; i++)
    {
        cin >> arr[i];
        for (j = 0 ; j < (i+1) ;j++)
        {
            Big.push_back(arr[j]);
        }
    }

    cout << Big[k-1];

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

	long long n , k  , i , j    ; cin >> n >> k ;
	vector <long long> Big;
	int arr[n+5];

	for (i = 0 ; i < n ; i++)
    {
        cin >> arr[i];
        for (j = 0 ; j < (i+1) ;j++)
        {
            Big.push_back(arr[j]);
        }
    }

    cout << Big[k-1];

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

	long n, k; scanf("%ld %ld\n", &n, &k);
    std::vector<long> id(n + 1);
    for(long p = 1; p <= n; p++){
        scanf("%ld ", &id[p]);
    }

    long current(0);
    while(k > 0){
        k -= ++current;
    }
    k += current;
    printf("%ld\n", id[k]);

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

	long n , k  , i , j    ; cin >> n >> k ;
	vector <long> Big;
	int arr[n+5];

	for (i = 0 ; i < n ; i++)
    {
        cin >> arr[i];
        for (j = 0 ; j < (i+1) ;j++)
        {
            Big.push_back(arr[j]);
        }
    }

    cout << Big[k-1];

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k;
    cin >> n >> k;
    int num[n];
    int sum[n];
    for(int i=0; i<n; i++)
    {
        int j = i+1;
        cin >> num[i];
        sum[i] = j*(j+1)/2;
    }
    if(k==1)
    {
        cout << num[0] << endl;
        return 0;
    }
    for(int i=n-1; i>=0; i--)
    {
        if(sum[i] < k)
        {
            cout << num[ k-sum[i]-1 ] << endl;
            break;
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k;
    cin >> n >> k;
    int num[n];
    int sum[n];
    for(int i=0; i<n; i++)
    {
        int j = i+1;
        cin >> num[i];
        sum[i] = j*(j+1)/2;
    }
    for(int i=n-1; i>=0; i--)
    {
        if(sum[i] < k)
        {
            cout << num[ k-sum[i]-1 ] << endl;
            break;
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    long long k;
    cin >> n >> k;
    long long num[n];
    long long sum[n];
    for(long long i=0; i<n; i++)
    {
        long long j = i+1;
        cin >> num[i];
        sum[i] = j*(j+1)/2;
    }
    if(k == 1)
    {
        cout << num[0] << endl;
        return 0;
    }
    for(long long i=n-1; i>=0; i--)
    {
        if(sum[i] < k)
        {
            long long index = k - sum[i] - 1 ;
            cout << num[ k-sum[i]-1 ] << endl;
            break;
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    long long k;
    cin >> n >> k;
    int num[n];
    long long sum[n];
    for(int i=0; i<n; i++)
    {
        int j = i+1;
        cin >> num[i];
        sum[i] = j*(j+1)/2;
    }
    if(k == 1)
    {
        cout << num[0] << endl;
        return 0;
    }
    for(int i=n-1; i>=0; i--)
    {
        if(sum[i] < k)
        {
            long long index = k - sum[i] - 1 ;
            cout << num[ k-sum[i]-1 ] << endl;
            break;
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    long long k;
    cin >> n >> k;
    int num[n];
    long long sum[n];
    for(int i=0; i<n; i++)
    {
        int j = i+1;
        cin >> num[i];
        sum[i] = j*(j+1)/2;
    }
    if(k==1)
    {
        cout << num[0] << endl;
        return 0;
    }
    for(int i=n-1; i>=0; i--)
    {
        if(sum[i] <= k)
        {
            if(sum[i] != k){
                cout << num[ k-sum[i]-1 ] << endl;
                break;
            }

            else{
                cout << num[i] << endl;
                break;
            }

        }
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    long long k;
    cin >> n >> k;
    int num[n];
    long long sum[n];
    for(int i=0; i<n; i++)
    {
        int j = i+1;
        cin >> num[i];
        sum[i] = j*(j+1)/2;
    }
    if(k==1)
    {
        cout << num[0] << endl;
        return 0;
    }
    for(int i=n-1; i>=0; i--)
    {
        if(sum[i] < k)
        {
            cout << num[ k-sum[i]-1 ] << endl;
            break;
        }
    }
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int N=1e2+5;
int main()
{
    map<ll,ll>mp;
    ll n,k,c=0,ind,prev,arr[N];
    cin>>n>>k;
    for(ll i=1;i<=n;i++)
    {
        cin>>arr[i];
        prev=c;
        c+=i;
        if(c>=k)
        {
            ind=i;
            break;
        }
    }
    for(ll i=1;i<=ind;i++)
    {
        prev++;
        if(prev==k)
            return cout<<arr[i],0;
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define f first
#define s second
using namespace std;
const int mod=1e5+7;
const int N=2e5+5;
int main()
{
    map<ll,ll>mp;
    ll n,k,counter=0,big,ind,arr[N];
    cin>>n>>k;
    for(ll i=1;i<=n;i++){
        cin>>arr[i];
        counter+=i;
        mp[i]=counter;
    }
    for(ll i=1;i<=n;i++){
        if(mp[i]>=k){
            big=mp[i];
            ind=i;
            break;
        }
    }
    for(ll i=ind;i>=1;i--){
        if(big==k)
            return cout<<arr[i],0;
        big--;
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int N=1e2+5;
int main()
{
    map<ll,ll>mp;
    ll n,k,c=0,ind,prev,arr[N],counter=0;
    cin>>n>>k;
    for(ll i=1;i<=n;i++)
    {
        cin>>arr[i];
        prev=c;
        c+=i;
        if(c>=k)
        {
            ind=i;
            break;
        }
    }
    cout<<arr[k-prev];
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int N=1e6+5;
int main()
{
    map<ll,ll>mp;
    ll n,k,c=0,ind,prev,arr[N],counter=0;
    cin>>n>>k;
    for(ll i=1;i<=n;i++)
    {
        cin>>arr[i];
        prev=c;
        c+=i;
        if(c>=k)
        {
            ind=i;
            break;
        }
    }
    cout<<arr[k-prev];
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int N=1e2+5;
int main()
{
    map<ll,ll>mp;
    ll n,k,c=0,arr[N];
    cin>>n>>k;
    for(ll i=1;i<=n;i++)
    {
        cin>>arr[i];
        c+=i;
        mp[i]=c;
    }
    for(int i=1;i<=n;i++)
    {
        if(mp[i]>=k)
        {
            ll prev=mp[i-1];
            for(int j=1;j<=i;j++)
            {
                prev++;
                if(prev==k)
                    return cout<<arr[j],0;
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define f first
#define s second
using namespace std;
const int mod=1e5+7;
const int N=2e5+5;
int main()
{
    pair<ll,ll>p[10005];
    ll n,k,arr[N],counter=0,ind,c;
    cin>>n>>k;
    for(ll i=1;i<=n;i++){
        cin>>arr[i];
        counter+=i;
        p[i].f=i,p[i].s=counter;
    }
    for(ll i=1;i<=n;i++){
        if(p[i].s>=k){
            ind=i;
            c=p[i].s;
            break;
        }
    }
    for(ll i=ind;i>=1;i--){
        if(c==k)
            return cout<<arr[i],0;
        c--;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll arr[100005];
ll binary_srch(ll k,ll n)
{
    ll h=n-1,l=0;
    while(l<=h)
    {
        ll m=(l+h)/2;
        if(arr[m]>k)
        h=m-1;
        else if(arr[m]<k)
        l=m+1;
        else
        return m;
    }
    return arr[h];
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll i;
       ll n,k;
    cin>>n>>k;
    arr[0]=1;
    for(i=1;i<n;i++)
    {
        arr[i]=i+1+arr[i-1];
    }

    ll seq[n];
    for(i=0;i<n;i++)
    cin>>seq[i];
    ll temp=binary_srch(k,n);
    //cout<<temp<<'\n';
    if(k==temp)
    cout<<seq[temp-1]<<'\n';
    else
    cout<<seq[k-temp-1]<<'\n';
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ios::sync_with_stdio(false); cin.tie(0);
    ll n; cin >> n;
    if(n == 1 || n == 2) cout << "No\n";
    else{
        cout << "Yes\n";
        cout << (n+1)/2 << " " << n/2 << "\n";
        for(int i = 1; i <= n; i+=2) {
            if(i != 1) cout << " ";
            cout << i;
        }
        for(int i = 2; i <= n; i+=2){
            cout << " ";
            cout << i;
        }
        cout  << "\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ios::sync_with_stdio(false); cin.tie(0);
    ll n; cin >> n;
    if((n+1)/2 %2) cout << "No\n";
    else{
        cout << "Yes\n";
        cout << (n+1)/2 << " " << n/2 << "\n";
        for(int i = 1; i <= n; i+=2) {
            if(i != 1) cout << " ";
            cout << i;
        }
        for(int i = 2; i <= n; i+=2){
            cout << " " << i;
        }
        cout  << "\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ios::sync_with_stdio(false); cin.tie(0);
   ll n; cin >> n;
   if(n <= 2) cout << "No\n";
   else{
        cout << "Yes\n";
        cout << 1 << " " << n<< "\n";
        cout << n-1 << " ";
        for(int = 1; i <= n-1; i++) cout << i << " ";

   }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ios::sync_with_stdio(false); cin.tie(0);
    ll n; cin >> n;
    if((n+1)/2 %2) cout << "No\n";
    else{
        cout << "Yes\n";
        cout << n/2 << " " << (n+1)/2 << "\n";
        for(int i = 2; i <= n; i+=2) {
            if(i != 2) cout << " ";
            cout << i;
        }
        for(int i = 1; i <= n; i+=2){
            cout << " " << i;
        }
        cout  << "\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ios::sync_with_stdio(false); cin.tie(0);
   ll n; cin >> n;
   if(n==1 || n==2) cout << "No\n";
   else{
        cout << "Yes\n";
        cout << 1 << " " << n-1 << "\n";
        cout << n << " " << n*(n-1)/2 << "\n";

   }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ios::sync_with_stdio(false); cin.tie(0);
   ll n; cin >> n;
   if(n==1 || n==2){
        cout << "No\n";
        return 0;
   }
   cout << "Yes\n";
   cout << 1 << " " << n-1 << "\n";
   if(n%2 ==0){
        cout << 2;
        for(int i = 1; i <= n; i++){
            if(i == 2) continue;
            cout << " " << i;
        }
        cout << "\n";
   }
   else{
        cout << 3;
        for(int i = 1; i <= n; i++){
            if(i == 3) continue;
            cout << " " << i;
        }
   }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ios::sync_with_stdio(false); cin.tie(0);
    ll n; cin >> n;
    if(n == 1 || n == 2) cout << "No\n";
    else{
        cout << "Yes\n";
        cout << n/2 << " " << (n+1)/2 << "\n";
        for(int i = 2; i <= n; i+=2) {
            if(i != 2) cout << " ";
            cout << i;
        }
        for(int i = 1; i <= n; i+=2){
            cout << " " << i;
        }
        cout  << "\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define f first
#define s second
#define mk make_pair
#define pb push_back
#define v vector
#define p pair
#define fr(i, a, b) for (int i = a; i < b; ++i)
#define frn(i, a, b) for (int i = a; i > b; --i)
#define MAX 1000005
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int sieve[MAX];
int main()
{
    IOS;
    int n;
    cin>>n;
    v<ll> primes;
    if(n<3)
    {
        cout<<"No"<<endl;
    }
    else
    {
        fr(i,2,MAX+1)
        {
            if(sieve[i]==0)
            {
                sieve[i]=i;
                for(int j=i+i;j<=MAX;j+=i)
                {
                    if(sieve[j]==0)
                        sieve[j]=i;
                }
                primes.push_back(i);
            }
        }
        cout<<"Yes"<<endl;
        int sum=n*(n+1)/2;
        int s1 = n-1,x;
        int s2 = 1;
        if(sum<100000)x = sieve[sum];
        else
        {
            for(int i=0;primes[i]*primes[i]<=n;i++)
            {
                if(sum%primes[i]==0)x=primes[i];
            }
        }
        cout<<s1<<" ";
        fr(i,1,n+1)
        {
            if(i==x)continue;
            cout<<i<<" ";
        }
        cout<<endl;
        cout<<s2<<" ";
        cout<<x<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define f first
#define s second
#define mk make_pair
#define pb push_back
#define v vector
#define p pair
#define fr(i, a, b) for (int i = a; i < b; ++i)
#define frn(i, a, b) for (int i = a; i > b; --i)
#define MAX 100005
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int main()
{
    IOS;
    int n;
    cin>>n;

    if(n<3)cout<<"No"<<endl;
    else
    {
        if((int)(ceil(n/2.0))%2==1)cout<<"No"<<endl;
        else
        {
            cout<<"Yes"<<endl;
            cout<<(int)ceil(n/2.0)<<" ";
            for(int i=1;i<=n;i+=2)
                cout<<i<<" ";
            cout<<endl;
            cout<<n-(int)ceil(n/2.0)<<" ";
            for(int i=2;i<=n;i+=2)
                cout<<i<<" ";
            cout<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define f first
#define s second
#define mk make_pair
#define pb push_back
#define v vector
#define p pair
#define fr(i, a, b) for (int i = a; i < b; ++i)
#define frn(i, a, b) for (int i = a; i > b; --i)
#define MAX 1000005
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int sieve[MAX];
int main()
{
    IOS;
    int n;
    cin>>n;
    v<ll> primes;
    if(n<3)
    {
        cout<<"No"<<endl;
    }
    else
    {
        fr(i,2,MAX)
        {
            if(sieve[i]==0)
            {
                sieve[i]=i;
                for(int j=i+i;j<MAX;j+=i)
                {
                    if(sieve[j]==0)
                        sieve[j]=i;
                }
                primes.push_back(i);
                //if(primes.size()<7)cout<<primes[primes.size()-1]<<" ";
            }
        }
        int sum=n*(n+1)/2;
        int s1 = n-1,x=-1;
        int s2 = 1;
        for(int i=0;primes[i]<=n;i++)
        {
            if(sum%primes[i]==0)x=primes[i];
        }
        if(x!=-1)
        {
            cout<<s1<<" ";
            fr(i,1,n+1)
            {
                if(i==x)continue;
                cout<<i<<" ";
            }
            cout<<endl;
            cout<<s2<<" ";
            cout<<x<<endl;
        }
        else cout<<"NO"<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define f first
#define s second
#define mk make_pair
#define pb push_back
#define v vector
#define p pair
#define fr(i, a, b) for (int i = a; i < b; ++i)
#define frn(i, a, b) for (int i = a; i > b; --i)
#define MAX 100005
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int sieve[MAX];
int main()
{
    IOS;
    int n;
    cin>>n;
    v<ll> primes;
    fr(i,2,MAX+1)
    {
        if(sieve[i]==0)
        {
            sieve[i]=i;
            for(int j=i+i;j<=MAX;j+=i)
            {
                if(sieve[j]==0)
                    sieve[j]=i;
            }
            primes.push_back(i);
        }
    }
    if(n<3)cout<<"No"<<endl;
    else
    {
        cout<<"Yes"<<endl;
        int sum=n*(n+1)/2;
        int s1 = n-1,x;
        int s2 = 1;
        if(sum<100000)x = sieve[sum];
        else
        {
            for(int i=0;primes[i]*primes[i]<=n;i++)
            {
                if(sum%primes[i]==0)x=primes[i];
            }
        }
        cout<<s1<<" ";
        fr(i,1,n+1)
        {
            if(i==x)continue;
            cout<<i<<" ";
        }
        cout<<endl;
        cout<<s2<<" ";
        cout<<x<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define f first
#define s second
#define mk make_pair
#define pb push_back
#define v vector
#define p pair
#define fr(i, a, b) for (int i = a; i < b; ++i)
#define frn(i, a, b) for (int i = a; i > b; --i)
#define MAX 1000005
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int sieve[MAX];
int main()
{
    IOS;
    int n;
    cin>>n;
    v<ll> primes;
    if(n<3)
    {
        cout<<"No"<<endl;
    }
    else
    {
        fr(i,2,MAX+1)
        {
            if(sieve[i]==0)
            {
                sieve[i]=i;
                for(int j=i+i;j<=MAX;j+=i)
                {
                    if(sieve[j]==0)
                        sieve[j]=i;
                }
                primes.push_back(i);
                //if(primes.size()<7)cout<<primes[primes.size()-1]<<" ";
            }
        }
        int sum=n*(n+1)/2;
        int s1 = n-1,x=-1;
        int s2 = 1;
        for(int i=0;primes[i]<=n;i++)
        {
            if(sum%primes[i]==0)x=primes[i];
        }
        if(x!=-1)
        {
            cout<<s1<<" ";
            fr(i,1,n+1)
            {
                if(i==x)continue;
                cout<<i<<" ";
            }
            cout<<endl;
            cout<<s2<<" ";
            cout<<x<<endl;
        }
        else cout<<"NO"<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define f first
#define s second
#define mk make_pair
#define pb push_back
#define v vector
#define p pair
#define fr(i, a, b) for (int i = a; i < b; ++i)
#define frn(i, a, b) for (int i = a; i > b; --i)
#define MAX 1000005
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int sieve[MAX];
int main()
{
    IOS;
    int n;
    cin>>n;
    v<ll> primes;
    if(n<3)
    {
        cout<<"No"<<endl;
    }
    else
    {
        fr(i,2,MAX)
        {
            if(sieve[i]==0)
            {
                sieve[i]=i;
                for(int j=i+i;j<MAX;j+=i)
                {
                    if(sieve[j]==0)
                        sieve[j]=i;
                }
                primes.push_back(i);
                //if(primes.size()<7)cout<<primes[primes.size()-1]<<" ";
            }
        }
        int sum=n*(n+1)/2;
        int s1 = n-1,x=-1;
        int s2 = 1;
        for(int i=0;primes[i]<=n;i++)
        {
            if(sum%primes[i]==0)x=primes[i];
        }
        if(x!=-1)
        {
            cout<<"Yes"<<endl;
            cout<<s1<<" ";
            fr(i,1,n+1)
            {
                if(i==x)continue;
                cout<<i<<" ";
            }
            cout<<endl;
            cout<<s2<<" ";
            cout<<x<<endl;
        }
        else cout<<"NO"<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define f first
#define s second
#define mk make_pair
#define pb push_back
#define v vector
#define p pair
#define fr(i, a, b) for (int i = a; i < b; ++i)
#define frn(i, a, b) for (int i = a; i > b; --i)
#define MAX 100005
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int main()
{
    IOS;
    int n;
    cin>>n;

    if(n<3)cout<<"No"<<endl;
    else
    {
        cout<<"Yes"<<endl;
        if((int)(ceil(n/2.0))%2==1)
        {
            cout<<n/2+1<<" ";
            for(int i=1;i<=n;i+=2)
                cout<<i<<" ";
            cout<<2<<endl;
            cout<<n-n/2-1<<" ";
            for(int i=4;i<=n;i+=2)
                cout<<i<<" ";
            cout<<endl;
        }
        else
        {
            cout<<n/2<<" ";
            for(int i=1;i<=n;i+=2)
                cout<<i<<" ";
            cout<<endl;
            cout<<n-n/2<<" ";
            for(int i=2;i<=n;i+=2)
                cout<<i<<" ";
            cout<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define f first
#define s second
#define mk make_pair
#define pb push_back
#define v vector
#define p pair
#define fr(i, a, b) for (int i = a; i < b; ++i)
#define frn(i, a, b) for (int i = a; i > b; --i)
#define MAX 100005
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int sieve[MAX];
int main()
{
    IOS;
    int n;
    cin>>n;
    fr(i,2,MAX+1)
    {
        if(sieve[i]==0)
        {
            sieve[i]=i;
            for(int j=i+i;j<=MAX;j+=i)
            {
                if(sieve[j]==0)
                    sieve[j]=i;
            }
        }
    }
    if(n<3)cout<<"No"<<endl;
    else
    {
        cout<<"Yes"<<endl;
        int sum=n*(n+1)/2;
        int x = sieve[sum];
        int s1 = n-1;
        int s2 = 1;

        cout<<s1<<" ";
        fr(i,1,n+1)
        {
            if(i==x)continue;
            cout<<i<<" ";
        }
        cout<<endl;
        cout<<s2<<" ";
        cout<<x<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define f first
#define s second
#define mk make_pair
#define pb push_back
#define v vector
#define p pair
#define fr(i, a, b) for (int i = a; i < b; ++i)
#define frn(i, a, b) for (int i = a; i > b; --i)
#define MAX 100005
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int sieve[MAX];
int main()
{
    IOS;
    int n;
    cin>>n;
    v<ll> primes;
    if(n<3)
    {
        cout<<"No"<<endl;
    }
    else
    {
        fr(i,2,MAX+1)
        {
            if(sieve[i]==0)
            {
                sieve[i]=i;
                for(int j=i+i;j<=MAX;j+=i)
                {
                    if(sieve[j]==0)
                        sieve[j]=i;
                }
                primes.push_back(i);
            }
        }
        cout<<"Yes"<<endl;
        int sum=n*(n+1)/2;
        int s1 = n-1,x;
        int s2 = 1;
        if(sum<100000)x = sieve[sum];
        else
        {
            for(int i=0;primes[i]*primes[i]<=n;i++)
            {
                if(sum%primes[i]==0)x=primes[i];
            }
        }
        cout<<s1<<" ";
        fr(i,1,n+1)
        {
            if(i==x)continue;
            cout<<i<<" ";
        }
        cout<<endl;
        cout<<s2<<" ";
        cout<<x<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define f first
#define s second
#define mk make_pair
#define pb push_back
#define v vector
#define p pair
#define fr(i, a, b) for (int i = a; i < b; ++i)
#define frn(i, a, b) for (int i = a; i > b; --i)
#define MAX 100005
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int main()
{
    IOS;
    int n;
    cin>>n;

    if(n<3)cout<<"No"<<endl;
    else
    {
        if((int)(ceil(n/2.0))%2==1)cout<<"No"<<endl;
        else
        {
            cout<<(int)ceil(n/2.0)<<" ";
            for(int i=1;i<=n;i+=2)
                cout<<i<<" ";
            cout<<endl;
            cout<<n-(int)ceil(n/2.0)<<" ";
            for(int i=2;i<=n;i+=2)
                cout<<i<<" ";
            cout<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef long long li;
#define endl '\n'

int a[26];
int main()
{
	int n;
	cin>>n;
	li sum[n+2];
	sum[0] = 0;
	int i;
	for(i = 1 ; i <= n ; ++i)
		sum[i] = sum[i-1] + i;

	li c = sum[n];
	int s1 = 0;
	for(i = 2 ; i <= n; )
	{
		if((c-i)%i == 0){
			s1 = i;
			break;
		}
		i++;
	}
	if(s1==0)
	{
		cout<<"No\n";
		return 0;
	}
	cout <<"Yes\n";
	cout<<"1"<<" "<<s1<<endl;

	cout<<n-1<<" ";
	for(i = 1 ; i <= n ; ++i)
		if(i!=s1)
			cout<<i<<" ";
	cout<<endl;
}


#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef long long li;
#define endl '\n'

int main()
{
	int n;
	cin>>n;
	li sum[n+2];
	sum[0] = 0;
	int i;
	for(i = 1 ; i <= n ; ++i)
		sum[i] = sum[i-1] + i;

	li c = sum[n];
	int s1 = 0;
	for(i = 2 ; i <= n; )
	{
		if(c%i == 0){
			s1 = i;
			break;
		}
		i++;
	}
	if(s1==0)
	{
		cout<<"No\n";
		return 0;
	}
	cout<<"Yes\n";
	cout<<"1"<<" "<<n-1<<endl;

	cout<<s1<<" ";
	for(i = 1 ; i <= n ; ++i)
		if(i!=s1)
			cout<<i<<" ";
	cout<<endl;
}


#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef long long li;
#define endl '\n'

int main()
{
	int n;
	cin>>n;

	if(n==1 || n==2)
	{
		cout<<"No\n";
		return 0;
	}
	cout<<"Yes\n";
	if(n&1)
		cout<<n/2 <<" "<<n/2 +1 << endl;
	else
		cout<< n/2 << " " << n/2 <<endl;

	for(int i = 1 ; i <= n ; ++i)
		if(!(i&1))
			cout<<i<<" ";
	//cout<<endl;

	for(int i = 1 ; i <= n ; ++i)
		if((i&1))
			cout<<i<<" ";
	cout<<endl;

}


#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef long long li;
#define endl '\n'

int a[26];
int main()
{
	int n;
	cin>>n;
	li sum[n+2];
	sum[0] = 0;
	int i;
	for(i = 1 ; i <= n ; ++i)
		sum[i] = sum[i-1] + i;

	li c = sum[n];
	int s1 = 0;
	for(i = 2 ; i <= n; )
	{
		if((c-i)%i == 0){
			s1 = i;
			break;
		}
		i++;
	}
	if(s1==0)
	{
		cout<<"No\n";
		return 0;
	}
	cout<<"Yes\n";
	cout<<"1"<<" "<<n-1<<endl;

	cout<<s1<<" ";
	for(i = 1 ; i <= n ; ++i)
		if(i!=s1)
			cout<<i<<" ";
	cout<<endl;
}


#include <bits/stdc++.h>
using namespace std;
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef long long li;
#define endl '\n'

int a[26];
int main()
{
	int n;
	cin>>n;
	li sum[n+2];
	sum[0] = 0;
	int i;
	for(i = 1 ; i <= n ; ++i)
		sum[i] = sum[i-1] + i;

	li c = sum[n];
	int s1 = 0;
	for(i = 2 ; i <= n; )
	{
		if((c-i)%i == 0){
			s1 = i;
			break;
		}
		i++;
	}
	if(s1==0)
	{
		cout<<"No\n";
		return 0;
	}
	cout<<"1"<<" "<<s1<<endl;

	cout<<n-1<<" ";
	for(i = 1 ; i <= n ; ++i)
		if(i!=s1)
			cout<<i<<" ";
	cout<<endl;
}


#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef long long li;
#define endl '\n'

int a[26];
int main()
{
	int n;
	cin>>n;
	li sum[n+2];
	sum[0] = 0;
	int i;
	for(i = 1 ; i <= n ; ++i)
		sum[i] = sum[i-1] + i;

	li c = sum[n];
	int s1 = 0;
	for(i = 2 ; i <= n; )
	{
		if((c-i)%i == 0){
			s1 = i;
			break;
		}
		i++;
	}
	if(s1==0)
	{
		cout<<"No\n";
		return 0;
	}
	cout<<"1"<<" "<<n-1<<endl;

	cout<<s1<<" ";
	for(i = 1 ; i <= n ; ++i)
		if(i!=s1)
			cout<<i<<" ";
	cout<<endl;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <map>
#include <cstdio>
#include <utility>
#include <vector>
#include <set>
using namespace std;

#define ll long long
#define endl "\n"

const int mxN = 1e5;

void solve()
{
    int n;
    cin>>n;
    if(n == 1)
    {
        cout<<"NO";
    }
    else
    {
        cout<<"YES";
        cout<<2<<endl<<2;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int T = 1;
    //cin>>T;
    while(T--)
    {
        solve();
        cout<<endl;
    }
    return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <map>
#include <cstdio>
#include <utility>
#include <vector>
#include <set>
using namespace std;

#define ll long long
#define endl "\n"

const int mxN = 1e5;

void solve()
{
    int n;
    cin>>n;
    if(n == 1)
    {
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        for(int i=0;i<n;i++)
        {
            cout<<i + 1<<' ';
        }
        cout<<endl;
        for(int i=0;i<n;i++)
        {
            cout<<i + 1<<' ';
        }
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int T = 1;
    //cin>>T;
    while(T--)
    {
        solve();
        cout<<endl;
    }
    return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <string>
#include <utility>
#include <cmath>
using namespace std;

const int mxN = 1e5;
#define ll long long

void solve()
{
    int n;
    cin>>n;
    if(n<=2)
    {
        cout<<"No";
        return;
    }
    else
    {
        cout<<"Yes"<<endl;
        int k=(n%2==0)?(n/2):((n+1)/2);
        cout<<"1 "<<k<<endl;
        cout<<n-1<<" ";
        for(int i=1;i<=n;i++)
        {
            if(i==k)
                continue;
            cout<<i<<" ";
        }
        cout<<endl;
    }
}

int main()
{
    int T = 1;
    //cin>>T;
    while(T--)
    {
        solve();
        //cout<<endl;
    }
    return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <map>
#include <cstdio>
#include <utility>
#include <vector>
#include <set>
using namespace std;

#define ll long long
#define endl "\n"

const int mxN = 1e5;

void solve()
{
    int n;
    cin>>n;
    if(n == 1)
    {
        cout<<"No";
    }
    else
    {
        cout<<"Yes";
        for(int i=0;i<n;i++)
        {
            cout<<i + 1<<' ';
        }
        cout<<endl;
        for(int i=0;i<n;i++)
        {
            cout<<i + 1<<' ';
        }
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int T = 1;
    //cin>>T;
    while(T--)
    {
        solve();
        cout<<endl;
    }
    return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <string>
#include <utility>
#include <cmath>
using namespace std;

const int mxN = 1e5;
#define ll long long

void solve()
{
    int n;
    cin>>n;
    if(n<=2)
    {
        cout<<"No";
        return 0;
    }
    else
    {
        cout<<"Yes"<<endl;
        int k=(n%2==0)?(n/2):((n+1)/2);
        cout<<"1 "<<k<<endl;
        cout<<n-1<<" ";
        for(int i=1;i<=n;i++)
        {
            if(i==k)
                continue;
            cout<<i<<" ";
        }
        cout<<endl;
    }
}

int main()
{
    int T = 1;
    //cin>>T;
    while(T--)
    {
        solve();
        cout<<endl;
    }
    return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <map>
#include <cstdio>
#include <utility>
#include <vector>
#include <set>
using namespace std;

#define ll long long
#define endl "\n"

const int mxN = 1e5;

void solve()
{
    int n;
    cin>>n;
    if(n == 1)
    {
        cout<<"No";
    }
    else
    {
        cout<<"Yes";
        cout<<2<<endl<<2;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int T = 1;
    //cin>>T;
    while(T--)
    {
        solve();
        cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    if (n<=2){
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<1<<" "<<n-1<<endl;
        cout<<1<<" ";
        for(int i=2;i<=n;i++){
            cout<<i<<" ";
        }
        return 0;
    }
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    if (n<=2){
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<2<<endl;
        cout<<1<<" ";
        for(int i=3;i<=n;i++){
            cout<<i<<" ";
        }
    }
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    if (n<=2){
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<1<<" "<<n-1<<endl;
        cout<<1<<" ";
        for(int i=2;i<=n;i++){
            cout<<i<<" ";
        }

    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main{
    int n;
    cin>>n;
    if (n<=2){
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<2<<endl;
        cout<<1<<3<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    int32_t n;
    cin>>n;
    if (n<=2){
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<1<<" "<<n-1<<endl;
        cout<<1<<" ";
        for(int32_t i=2;i<=n;i++){
            cout<<i<<" ";
        }

    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    if (n<=2){
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<1<<" "<<n<<endl;
        for(int i=1;i<=n;i++){
            cout<<i<<" ";
        }
       cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    if (n<=2){
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<2<<endl;
        cout<<1<<3<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    if (n<=2){
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<2<<endl;
        cout<<1<<" ";
        for(int i=2;i<=n;i++){
            cout<<i<<" ";
        }
    }
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    if (n<=2){
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<2<<endl;
        cout<<1<<" "<<3<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    if (n<=2){
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<1<<" "<<n-1<<endl;
        cout<<1<<" ";
        for(int i=2;i<=n;i++){
            cout<<i<<" ";
        }
    }
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    if (n<=2){
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<1<<" "<<n<<endl;
        for(int i=n;i>0;i--){
            cout<<i<<" ";
        }
       cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    if (n<=2){
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<1<<" "<<n-1<<endl;
        for(int i=1;i<=n;i++){
            cout<<i<<" ";
        }
       cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    if (n<=2){
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<1<<" "<<n-1<<endl;
        cout<<n-1<<" ";
        for(int i=n;i>0;i--){
            if (i==n-1){
                continue;
            }
            cout<<i<<" ";
        }
       cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    if (n<=2){
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<2<<endl;
        cout<<1<<" "<<3;
    }
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    if (n<=2){
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<1<<" "<<n<<endl;
        cout<<n-1<<" ";
        for(int i=n;i>0;i--){
            if (i==n-1){
                continue;
            }
            cout<<i<<" ";
        }
       cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    if (n<=2){
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<1<<" "<<n<<endl;
        cout<<n-1<<" ";
        for(int i=n-1;i>0;i--){
            cout<<i<<" ";
        }
       cout<<endl;
    }
    return 0;
}


#include <iostream>
#include <vector>

using namespace std;
using ll = long long;

int gcd (int a, int b) {
    if (b == 0)
        return a;
    else
        return gcd (b, a % b);
}

int main() {
    ll n;
    cin >> n;
    ll sum = 0;
    for (int i = 1;i <= n;i++){
        sum += i;
    }

    vector<int> s1;
    vector<int> s2;
    ll curSum = 0;
    for (int i = 1;i < sum + 1/2;i++){
        if (gcd(i,sum - i) > 1){
            cout << "Yes" << endl;
            for (int j = n;j >= 1;j--) {
                if (curSum + j <= i) {
                    curSum += j;
                    s1.push_back(j);
                } else{
                    s2.push_back(j);
                }
            }
            cout << s1.size() << ' ';
            for (auto el : s1)
                cout << el << ' ';
            cout << endl;
            cout << s2.size() << ' ';
            for (auto el : s2)
                cout << el << ' ';
            cout << endl;

            return 0;
        }
    }
    cout << "No" << endl;

    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <fstream>
#include <queue>
#include <math.h>
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2")

using std::cin;
using std::cout;
using std::endl;
using std::vector;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vell = vector<ll>;
using pii = std::pair<int, int>;
using vpii = vector<pii>;
using vchar = vector<char>;
using vvchar = vector<vchar>;
using trio = std::pair<ll, std::pair<ll, ll>>;
#define forx(x, n) for(int x = 0; x < n; ++x)
#define isz(x) (int)(x).size()
#define all(x) begin(x), end(x)
#define pb push_back

int main()
{
	cin.tie(0);
	cout.tie(0);
	std::ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	if (n < 3) cout << "No\n";
	else
	{
		cout << "Yes\n";
		int x;
		if (n % 3 == 0) x = 2;
		else if (n % 3 == 1) x = 4;
		else x = 3;
		cout << 1 << " " << x << "\n";
		cout << n - 1 << " ";
		for (int i = 1; i <= n; ++i) if (i != x) cout << i << " ";
		cout << "\n";
	}
	return 0;
}


//
//  main.cpp
//  taskA
//
//  Created by Даниил Автушко on 12.07.2018.
//  Copyright © 2018 Даниил Автушко. All rights reserved.
//

#include <iostream>
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <iomanip>
#include <map>
#include <list>
using namespace std;
int gcd (int a, int b);
int main(){
    int n,sum = 0;
    cin >> n;
    for (int i =1;i < n+1;i++)
        sum +=i;
    for (int i = 1;i < n;i++)
        if (gcd(i,sum-i) > 1){
            cout << "YES" << endl;
            cout << 1 << ' ' << i << endl;
            cout << n - 1 << ' ';
            for (int j = 1;j < n+1;j++)
                if (j != i) cout << j << ' ';
            return 0;
        }
    cout << "NO" << endl;
    return 0;
}
int gcd (int a, int b) {
    if (b == 0)
        return a;
    else
        return gcd (b, a % b);
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <fstream>
#include <queue>
#include <math.h>
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2")

using std::cin;
using std::cout;
using std::endl;
using std::vector;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vell = vector<ll>;
using pii = std::pair<int, int>;
using vpii = vector<pii>;
using vchar = vector<char>;
using vvchar = vector<vchar>;
using trio = std::pair<ll, std::pair<ll, ll>>;
#define forx(x, n) for(int x = 0; x < n; ++x)
#define isz(x) (int)(x).size()
#define all(x) begin(x), end(x)
#define pb push_back

int main()
{
	cin.tie(0);
	cout.tie(0);
	std::ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	if (n < 3) cout << "No\n";
	else
	{
		cout << "Yes\n";
		ll sum = (n + 1) * n / 2;
		int to_get;
		if (sum % 2 == 0) to_get = sum / 2;
		else
		{
			for (int i = 2; i * i <= sum; ++i) if (sum % i == 0) { to_get = sum / i; break; }
		}
		vi used(n + 1, 0);
		for (int i = n; i >= 1; --i) if (i <= to_get) to_get -= i, used[i] = 1;
		cout << std::count(all(used), 1) << " ";
		for (int i = 1; i <= n; ++i) if (used[i]) cout << i << " ";
		cout << "\n";
		cout << std::count(all(used), 0) - 1 << " ";
		for (int i = 1; i <= n; ++i) if (!used[i]) cout << i << " ";
	}
	return 0;
}


#include <iostream>
#include <vector>

using namespace std;
using ll = long long;

int gcd (int a, int b) {
    if (b == 0)
        return a;
    else
        return gcd (b, a % b);
}

int main() {
    ll n;
    cin >> n;
    ll sum = 0;
    for (int i = 1;i <= n;i++){
        sum += i;
    }

    vector<int> s1;
    vector<int> s2;
    ll curSum = 0;
    for (int i = 1;i < sum + 1/2;i++){
        if (gcd(i,sum - i) > 1){
            cout << "YES" << endl;
            for (int j = n;j >= 1;j--) {
                if (curSum + j <= i) {
                    curSum += j;
                    s1.push_back(j);
                } else{
                    s2.push_back(j);
                }
            }
            cout << s1.size() << ' ';
            for (auto el : s1)
                cout << el << ' ';
            cout << endl;
            cout << s2.size() << ' ';
            for (auto el : s2)
                cout << el << ' ';
            cout << endl;

            return 0;
        }
    }
    cout << "NO" << endl;

    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <fstream>
#include <queue>
#include <math.h>
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2")

using std::cin;
using std::cout;
using std::endl;
using std::vector;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vell = vector<ll>;
using pii = std::pair<int, int>;
using vpii = vector<pii>;
using vchar = vector<char>;
using vvchar = vector<vchar>;
using trio = std::pair<ll, std::pair<ll, ll>>;
#define forx(x, n) for(int x = 0; x < n; ++x)
#define isz(x) (int)(x).size()
#define all(x) begin(x), end(x)
#define pb push_back

int main()
{
	cin.tie(0);
	cout.tie(0);
	std::ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	if (n < 3) cout << "No\n";
	else
	{
		cout << "Yes\n";
		int x;
		if (n % 3 == 2)
		{
			x = 3;
			cout << 1 << " " << 3 << "\n";
			cout << n - 1 << " ";
			for (int i = 1; i <= n; ++i) if (i != x) cout << i << " ";
			cout << "\n";
		}
		else if(n % 3 == 0)
		{
			if (n % 6 != 0)
			{
				x = 3;
				cout << 1 << " " << 3 << "\n";
				cout << n - 1 << " ";
				for (int i = 1; i <= n; ++i) if (i != x) cout << i << " ";
				cout << "\n";
			}
			else
			{
				cout << n / 3 << " ";
				for (int i = 3; i <= n; i += 3) cout << i << " ";
				cout << "\n";
				cout << (n - (n / 3)) << " ";
				for (int i = 1; i <= n; ++i) if (i % 3 != 0) cout << i << " ";
				cout << "\n";
			}
		}
		else
		{
			if (n == 4)
			{
				cout << 1 << " " << 4 << "\n";
				cout << 3 << " " << 1 << " " << 2 << " " << 3;
				cout << "\n";
			}
			else
			{
				if (n % 2 == 0)
				{
					x = 5;
					cout << 1 << " " << x << "\n";
					cout << n - 1 << " ";
					for (int i = 1; i <= n; ++i) if (i != x) cout << i << " ";
					cout << "\n";
				}
				else
				{
					x = 4;
					cout << 1 << " " << x << "\n";
					cout << n - 1 << " ";
					for (int i = 1; i <= n; ++i) if (i != x) cout << i << " ";
					cout << "\n";
				}
			}
		}
	}
	return 0;
}


//
//  main.cpp
//  taskA
//
//  Created by Даниил Автушко on 12.07.2018.
//  Copyright © 2018 Даниил Автушко. All rights reserved.
//

#include <iostream>
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <iomanip>
#include <map>
#include <list>
using namespace std;
int gcd (int a, int b);
int main(){
    int n,sum = 0;
    cin >> n;
    for (int i =1;i < n+1;i++)
        sum +=i;
    for (int i = 1;i < n;i++)
        if (gcd(i,sum-i) > 1){
            cout << "Yes" << endl;
            cout << 1 << ' ' << i << endl;
            cout << n - 1 << ' ';
            for (int j = 1;j < n+1;j++)
                if (j != i) cout << j << ' ';
            return 0;
        }
    cout << "No" << endl;
    return 0;
}
int gcd (int a, int b) {
    if (b == 0)
        return a;
    else
        return gcd (b, a % b);
}


#include<bits/stdc++.h>
using namespace std;
long long a[200000];
int main()
{
    long long i,n,c,x;
    cin>>n;
    if(n<2)
    {
        cout<<"NO";
    }
    else
    {
        cout<<"YES"<<endl;
        cout<<n<<endl;
        for(i=1;i<=n;i++)
        {
            cout<<i<<" ";
        }
        cout<<endl;
    }

   return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long a[200000];
int main()
{
    long long i,n,c,x;
    cin>>n;
    if(n<2)
    {
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<"1"<<" "<<n<<endl;
        cout<<n<<" ";
        for(i=1;i<=n;i++)
        {
            cout<<i<<" ";
        }
        cout<<endl;
    }

   return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long a[200000];
int main()
{
    long long i,n,c,x;
    cin>>n;
    if(n<2)
    {
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<n<<endl;
        for(i=1;i<=n;i++)
        {
            cout<<i<<" ";
        }
        cout<<endl;
    }

   return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long a[200000];
int main()
{
    long long i,n,c,x;
    cin>>n;
    if(n<=2)
    {
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<"1"<<" "<<n<<endl;
        cout<<n-1<<" ";
        for(i=1;i<=n-1;i++)
        {
            cout<<i<<" ";
        }
        cout<<endl;
    }

   return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long a[200000];
int main()
{
    long long i,n,c,x;
    cin>>n;
    if(n<2)
    {
        cout<<"No";
    }
    else
    {
        cout<<"Yes"<<endl;
        cout<<n<<endl;
        for(i=1;i<=n;i++)
        {
            cout<<i<<" ";
        }

    }

   return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define pb push_back
const int N=100005;
const int MOD=1e9+7;

// lower_bound - which does not compare less than val
// upper_bound - which compares greater than val
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl

int32_t main()
{

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  /* stuff you should look for
  * int overflow, array bounds
  * special cases (n=1?)
  * do smth instead of nothing and stay organized
*/

int n;
cin>>n;
if(n==2 || n==1)
cout<<"No"<<endl;
else
{
	if(n%2)
	{
		cout<<"Yes"<<endl;
		cout<<n/2+1<<" ";
		for(int i=1;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		cout<<n/2<<" ";
		for(int i=2;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
	}
	else
	{
		cout<<"Yes"<<endl;
		cout<<n/2<<" ";
		for(int i=1;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		cout<<n/2<<" ";
		for(int i=2;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
	}

}

}


#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
//#define int long long
#define pb push_back
const int N=100005;
const int MOD=1e9+7;

// lower_bound - which does not compare less than val
// upper_bound - which compares greater than val
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl

int main()
{

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  /* stuff you should look for
  * int overflow, array bounds
  * special cases (n=1?)
  * do smth instead of nothing and stay organized
*/

int n;
cin>>n;
if(n==2 || n==1)
cout<<"No"<<endl;
else
{
	if(n%2)
	{
		cout<<"Yes"<<endl;
		for(int i=1;i<=n;i++)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		for(int i=1;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
	}
	else
	{
		cout<<"Yes"<<endl;
		for(int i=1;i<=n;i++)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		for(int i=1;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
	}

}

}


#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
//#define int long long
#define pb push_back
const int N=100005;
const int MOD=1e9+7;

// lower_bound - which does not compare less than val
// upper_bound - which compares greater than val
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl

int main()
{

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  /* stuff you should look for
  * int overflow, array bounds
  * special cases (n=1?)
  * do smth instead of nothing and stay organized
*/

int n;
cin>>n;
if(n==2 || n==1)
{
cout<<"No"<<endl;
}
else
{
	if(n%2)
	{
		cout<<"Yes"<<endl;
		cout<<n<<" ";
		for(int i=1;i<=n;i++)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		cout<<1<<" ";
		cout<<3<<endl;
	}
	else
	{
		cout<<"Yes"<<endl;
		cout<<n<<" ";
		for(int i=1;i<=n;i++)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		cout<<1<<" ";
		cout<<3<<endl;
	}

}

}


#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define pb push_back
const int N=100005;
const int MOD=1e9+7;

// lower_bound - which does not compare less than val
// upper_bound - which compares greater than val
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl

int32_t main()
{

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  /* stuff you should look for
  * int overflow, array bounds
  * special cases (n=1?)
  * do smth instead of nothing and stay organized
*/

int n;
cin>>n;
if(n==0 || n==1)
cout<<0<<endl;
else
{
	if(n%2)
	{
		cout<<"YES"<<endl;
		for(int i=1;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		for(int i=2;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
	}
	else
	{
		cout<<"YES"<<endl;
		for(int i=1;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		for(int i=2;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
	}

}

}


#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define pb push_back
const int N=100005;
const int MOD=1e9+7;

// lower_bound - which does not compare less than val
// upper_bound - which compares greater than val
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl

int32_t main()
{

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  /* stuff you should look for
  * int overflow, array bounds
  * special cases (n=1?)
  * do smth instead of nothing and stay organized
*/

int n;
cin>>n;
if(n==2 || n==1)
cout<<"NO"<<endl;
else
{
	if(n%2)
	{
		cout<<"YES"<<endl;
		for(int i=1;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		for(int i=2;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
	}
	else
	{
		cout<<"YES"<<endl;
		for(int i=1;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		for(int i=2;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
	}

}

}


#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
//#define int long long
#define pb push_back
const int N=100005;
const int MOD=1e9+7;

// lower_bound - which does not compare less than val
// upper_bound - which compares greater than val
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl

int main()
{

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  /* stuff you should look for
  * int overflow, array bounds
  * special cases (n=1?)
  * do smth instead of nothing and stay organized
*/

int n;
cin>>n;
if(n==2 || n==1)
{
cout<<"No"<<endl;
}
else
{
	if(n%2)
	{
		cout<<"Yes"<<endl;
		for(int i=1;i<=n;i++)
		{
			cout<<i<<" ";
		}
		cout<<endl;

		cout<<3<<endl;
	}
	else
	{
		cout<<"Yes"<<endl;
		for(int i=1;i<=n;i++)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		cout<<3<<endl;
	}

}

}


#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define pb push_back
const int N=100005;
const int MOD=1e9+7;

// lower_bound - which does not compare less than val
// upper_bound - which compares greater than val
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl

int32_t main()
{

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  /* stuff you should look for
  * int overflow, array bounds
  * special cases (n=1?)
  * do smth instead of nothing and stay organized
*/

int n;
cin>>n;
if(n==2 || n==1)
cout<<"NO"<<endl;
else
{
	if(n%2)
	{
		cout<<"YES"<<endl;
		cout<<n/2+1<<" ";
		for(int i=1;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		cout<<n/2<<" ";
		for(int i=2;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
	}
	else
	{
		cout<<"YES"<<endl;
		cout<<n/2<<" ";
		for(int i=1;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		cout<<n/2<<" ";
		for(int i=2;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
	}

}

}


#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
//#define int long long
#define pb push_back
const int N=100005;
const int MOD=1e9+7;

// lower_bound - which does not compare less than val
// upper_bound - which compares greater than val
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl

int main()
{

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  /* stuff you should look for
  * int overflow, array bounds
  * special cases (n=1?)
  * do smth instead of nothing and stay organized
*/

int n;
cin>>n;
if(n==2 || n==1)
cout<<"No"<<endl;
else
{
	if(n%2)
	{
		cout<<"Yes"<<endl;
		for(int i=1;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		for(int i=2;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
	}
	else
	{
		cout<<"Yes"<<endl;
		for(int i=1;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		for(int i=2;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
	}

}

}


#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define pb push_back
const int N=100005;
const int MOD=1e9+7;

// lower_bound - which does not compare less than val
// upper_bound - which compares greater than val
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl

int32_t main()
{

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  /* stuff you should look for
  * int overflow, array bounds
  * special cases (n=1?)
  * do smth instead of nothing and stay organized
*/

int n;
cin>>n;
if(n==2 || n==1)
cout<<"No"<<endl;
else
{
	if(n%2)
	{
		cout<<"Yes"<<endl;
		for(int i=1;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		for(int i=2;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
	}
	else
	{
		cout<<"Yes"<<endl;
		for(int i=1;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
		for(int i=2;i<=n;i+=2)
		{
			cout<<i<<" ";
		}
		cout<<endl;
	}

}

}


#include "bits/stdc++.h"

using namespace std;

int main(){
int n;
cin >> n;
if (n<=2){
	printf("No");
	return 0;
}
cout << "Yes" << endl;
cout << n%2 == 0 ? n/2 : n/2 + 1 << " ";
for (int i=1; i<=n; ++i){
	if (i%2) cout << i << " ";
}
cout<<endl;
cout << n%2 == 0 ? n/2 : n/2 << " ";
for (int i=1; i<=n; ++i){
	if(!(i%2)) cout << i << " ";
}
}


#include "bits/stdc++.h"

using namespace std;

int main(){
int n;
cin >> n;
if (n<=2){
	printf("No");
	return 0;
}
cout << "Yes" << endl;
cout << (n%2 == 0 ? n/2 : n/2 + 1) << " ";
for (int i=1; i<=n; ++i){
	if (i%2) cout << i << " ";
}
cout<<endl;
cout << (n%2 == 0 ? n/2 : n/2) << " ";
for (int i=1; i<=n; ++i){
	if(!(i%2)) cout << i << " ";
}
}


#include "bits/stdc++.h"

using namespace std;

int main(){
int n;
cin >> n;
if (n<=2){
	printf("No");
	return 0;
}
cout << "Yes" << endl;
for (int i=1; i<=n; ++i){
	if (i%2) cout << i << " ";
}
cout<<endl;
for (int i=1; i<=n; ++i){
	if(!(i%2)) cout << i << " ";
}
}


#include "bits/stdc++.h"

using namespace std;

int main(){
int n;
cin >> n;
if (n<=2){
	printf("No");
	return 0;
}
cout << "Yes" << endl;
cout << 1 << " ";
for (int i=1; i<=n; ++i){
	if (i%2) cout << i << " ";
}
cout<<endl;
cout << 2 << " ";
for (int i=1; i<=n; ++i){
	if(!(i%2)) cout << i << " ";
}
}


#include "bits/stdc++.h"

using namespace std;

int main(){
int n;
cin >> n;
if (n==2){
	printf("No");
	return 0;
}
printf("Yes");
for (int i=1; i<=n; ++i){
	if (i%2) cout << i << " ";
}
cout<<endl;
for (int i=1; i<=n; ++i){
	if(!(i%2)) cout << i << " ";
}
}


#include "bits/stdc++.h"

using namespace std;

int main(){
int n;
cin >> n;
if (n<=2){
	printf("No");
	return 0;
}
printf("Yes");
for (int i=1; i<=n; ++i){
	if (i%2) cout << i << " ";
}
cout<<endl;
for (int i=1; i<=n; ++i){
	if(!(i%2)) cout << i << " ";
}
}


#include<bits/stdc++.h>

using namespace std;
int n;
int main(){
	cin>>n;
	int arr[n],brr[n-1];
	if (n==1) cout<< "No";
	else{
	 cout<<"Yes"<<endl;

	cout<<endl;
	for (int j=0;j<n-1;j++){
		brr[j]=j+1;
		cout<<brr[j]<<" ";
	}
	cout<<endl;
	for (int i=0;i<n;i++){
		arr[i]=i+1;
		cout<<arr[i]<<" ";
	}
}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;
int n;
int main(){
	cin>>n;
	int arr[n];
	if (n<3){ cout<< "No";
	return 0;
	}
	else{
	 cout<<"Yes"<<endl;

	cout<<endl;
	cout<<"1"<<" "<<n;
	}
	cout<<endl<<n-1<<" ";
	for (int i=1;i<n;i++){
		arr[i]=i;
		cout<<arr[i]<<" ";
	}

	return 0;
}


#include<bits/stdc++.h>

using namespace std;
int n;
int main(){
	cin>>n;
	int arr[n];
	if (n==1) cout<< "No";
	else{
	 cout<<"Yes"<<endl;

	cout<<endl;
	cout<<"1"<<" "<<n;
	}
	cout<<endl;
	for (int i=0;i<n;i++){
		arr[i]=i+1;
		cout<<arr[i]<<" ";
	}

	return 0;
}


#include<bits/stdc++.h>

using namespace std;
int n;
int main(){
	cin>>n;
	int arr[n],brr[n-1];
	if (n==1) cout<< "No";
	else{
	 cout<<"Yes"<<endl;
	for (int i=0;i<n;i++){
		arr[i]=i+1;
		cout<<arr[i];
	}
	cout<<endl;
	for (int j=0;j<n-1;j++){
		brr[j]=j+1;
		cout<<brr[j];
	}
}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;
int n;
int main(){
	cin>>n;
	int arr[n],brr[n-1];
	if (n==1) cout<< "No";
	else cout<<"Yes"<<endl;
	for (int i=0;i<n;i++){
		arr[i]=i+1;
		cout<<arr[i];
	}
	cout<<endl;
	for (int j=0;j<n-1;j++){
		brr[j]=j+1;
		cout<<brr[j];
	}

}


#include<bits/stdc++.h>

using namespace std;
int n;
int main(){
	cin>>n;
	int arr[n];
	if (n<3){ cout<< "No";
	return 0;
	}
	else{
	 cout<<"Yes"<<endl;

	cout<<endl;
	cout<<"1"<<" "<<n;
	}
	cout<<endl;
	for (int i=0;i<n;i++){
		arr[i]=i+1;
		cout<<arr[i]<<" ";
	}

	return 0;
}


#include<bits/stdc++.h>

using namespace std;
int n;
int main(){
	cin>>n;
	int arr[n],brr[n-1];
	if (n==1) cout<< "No";
	else cout<<"Yes"<<endl;
	for (int i=0;i<n;i++){
		arr[i]=i+1;
		cout<<arr[i];
	}
	cout<<endl;
	for (int j=0;j<n-1;j++){
		brr[j]=j+1;
		cout<<brr[j];
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;
int n;
int main(){
	cin>>n;
	int arr[n],brr[n-1];
	if (n==1) cout<< "No";
	else{
	 cout<<"Yes"<<endl;

	cout<<endl;
	cout<<"1"<<" "<<"n";
	}
	cout<<endl;
	for (int i=0;i<n;i++){
		arr[i]=i+1;
		cout<<arr[i]<<" ";
	}
}
	return 0;
}


#include<iostream>
using namespace std;
int n;
int main(){
	cin>>n;
	int i;
	if(n==1||n==2)
	cout<<"No"<<endl;
	else{
	cout<<"Yes"<<endl;
	cout<<1<<" "<<n<<endl;;
	for(i=1;i<=n-1;i++)
	cout<<i<<" ;
	cout<<n<<endl;
}

}


#include<iostream>
using namespace std;
int n;
int main(){
	cin>>n;
	int i;
	if(n==1||n==2)
	cout<<"No"<<endl;
	else{
	cout<<"Yes"<<endl;
	cout<<1<<" "<<n<<endl;
	cout<<n-1<<" ";
	for(i=1;i<=n-1;i++)
	cout<<i<<" ";
	cout<<n<<endl;
}

}


#include<iostream>
using namespace std;
int n;
int main(){
	cin>>n;
	int i;
	if(n==1||n==2)
	cout<<"No"<<endl;
	else{
	cout<<"Yes"<<endl;
	cout<<1<<" "<<n-1<<endl;
	for(i=1;i<n;i++)
	cout<<i<<" ";
	cout<<" "<<n;
}

}


#include<iostream>
using namespace std;
int n;
int main(){
	cin>>n;
	int i;
	if(n==1||n==2)
	cout<<"No"<<endl;
	else{
	cout<<"Yes"<<endl;
	cout<<1<<" "<<n-1<<endl;
	for(i=1;i<n;i++)
	cout<<i<<" ";3
	cout<<" "<<n;
}

}


#include<iostream>
using namespace std;
int n;
int main(){
	cin>>n;
	int i;
	if(n==1||n==2)
	cout<<"No"<<endl;
	else{
	cout<<"Yes"<<endl;
	for(i=1;i<=n-1;i++)
	cout<<i<<" ";
	cout<<endl;
	cout<<1<<" "<<n<<endl;
}

}


#include<iostream>
using namespace std;
int n;
int main(){
	cin>>n;
	int i;
	if(n==1||n==2)
	cout<<"No"<<endl;
	else{
	cout<<"Yes"<<endl;
	cout<<n-1<<"";
	for(i=1;i<=n-1;i++)
	cout<<i<<" ";
	cout<<endl;
	cout<<1<<" "<<n<<endl;
}

}


#include<iostream>
using namespace std;
int n;
int main(){
	cin>>n;
	int i;
	if(n==1||n==2)
	cout<<"No"<<endl;
	else{
	cout<<"Yes"<<endl;
	cout<<1<<" "<<n<<endl;
	cout<<n-1<<"  " ;
	for(i=1;i<n;i++)
	cout<<i<<" ";
	cout<<endl;
}

}


#include<iostream>
using namespace std;
int n;
int main(){
	cin>>n;
	int i;
	if(n==1||n==2)
	cout<<"No"<<endl;
	else{
	cout<<"Yes"<<endl;
	cout<<1<<" "<<n<<endl;
	cout<<n-1<<" ";
	for(i=1;i<n;i++)
	cout<<i<<" ";
	cout<<endl;
}

}


#include<string>
#include<math.h>
#include<iterator>
#include<set>
#include<bits/stdc++.h>
using namespace std;

int solve()
{
	int n,m=INT_MAX,i,k2;

	cin>>n;
	set <int> a,b;
	if(n==2||n==1)
	cout<<"No";
        else
	if(n%2==0)
	{
		cout<<"Yes"<<"\n";
		i=1;
		while(i!=n+1)
		{
			if(i%2==1)
			a.insert(i);
			else
			b.insert(i);
			i++;
		}
		cout<<a.size()<<" ";
		set <int>::iterator itr;
		for(itr=a.begin();itr!=a.end();++itr)
		{
			cout<<*itr<<" ";
		}
		cout<<"\n"<<b.size()<<" ";
			for(itr=b.begin();itr!=b.end();++itr)
		{
			cout<<*itr<<" ";
		}
	}
	else if((n*(n+1)/2))
	{
		cout<<"Yes"<<"\n";
		if(2<n)
		{
			cout<<"1"<<" "<<(n+1)/2<<"\n";
		}
		cout<<n-1<<" ";
		i=1;
		while(i!=n+1)
		{
			if(i!=(n+1)/2)
			cout<<i<<" ";
			i++;
		}
		cout<<"\n";
	}
	else
	{
		cout<<"No"<<"\n";
	}

	return 0;
}

int main()
{

		solve();

}


#include<string>
#include<math.h>
#include<iterator>
#include<set>
#include<bits/stdc++.h>
using namespace std;

int solve()
{
	int n,m=INT_MAX,i,k2;

	cin>>n;
	set <int> a,b;
	if(n==2||n==1)
	cout<<"No";
	if(n%2==0)
	{
		cout<<"Yes"<<"\n";
		i=1;
		while(i!=n+1)
		{
			if(i%2==1)
			a.insert(i);
			else
			b.insert(i);
			i++;
		}
		cout<<a.size()<<" ";
		set <int>::iterator itr;
		for(itr=a.begin();itr!=a.end();++itr)
		{
			cout<<*itr<<" ";
		}
		cout<<"\n"<<b.size()<<" ";
			for(itr=b.begin();itr!=b.end();++itr)
		{
			cout<<*itr<<" ";
		}
	}
	else if((n*(n+1)/2))
	{
		cout<<"Yes"<<"\n";
		if(2<n)
		{
			cout<<"1"<<" "<<(n+1)/2<<"\n";
		}
		cout<<n-1<<" ";
		i=1;
		while(i!=n+1)
		{
			if(i!=(n+1)/2)
			cout<<i<<" ";
			i++;
		}
		cout<<"\n";
	}
	else
	{
		cout<<"No"<<"\n";
	}

	return 0;
}

int main()
{

		solve();

}


#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<math.h>
#include<iterator>
#include<set>
//#include<bits/stdc++.h>
using namespace std;

int solve()
{
	int n,m=INT_MAX,i,k2;

	cin>>n;
	set <int> a,b;
	if(n%2==0)
	{
		cout<<"Yes"<<"\n";
		i=1;
		while(i!=n+1)
		{
			if(i%2==1)
			a.insert(i);
			else
			b.insert(i);
			i++;
		}
		cout<<a.size()<<" ";
		set <int>::iterator itr;
		for(itr=a.begin();itr!=a.end();++itr)
		{
			cout<<*itr<<" ";
		}
		cout<<"\n"<<b.size()<<" ";
			for(itr=b.begin();itr!=b.end();++itr)
		{
			cout<<*itr<<" ";
		}
	}
	else if((n*(n+1)/2)%2==0)
	{
		cout<<"Yes"<<"\n";
		if(2<n)
		{
			cout<<"1"<<" "<<"2"<<"\n";
		}
		cout<<n-1<<" ";
		i=1;
		while(i!=n+1)
		{
			if(i!=2)
			cout<<i<<" ";
			i++;
		}
		cout<<"\n";
	}
	else
	{
		cout<<"No"<<"\n";
	}

	return 0;
}

int main()
{

		solve();

}


#include<string>
#include<math.h>
#include<iterator>
#include<set>
//#include<bits/stdc++.h>
using namespace std;

int solve()
{
	int n,m=INT_MAX,i,k2;

	cin>>n;
	set <int> a,b;
	if(n==2)
	cout<<"No";
	if(n%2==0)
	{
		cout<<"Yes"<<"\n";
		i=1;
		while(i!=n+1)
		{
			if(i%2==1)
			a.insert(i);
			else
			b.insert(i);
			i++;
		}
		cout<<a.size()<<" ";
		set <int>::iterator itr;
		for(itr=a.begin();itr!=a.end();++itr)
		{
			cout<<*itr<<" ";
		}
		cout<<"\n"<<b.size()<<" ";
			for(itr=b.begin();itr!=b.end();++itr)
		{
			cout<<*itr<<" ";
		}
	}
	else if((n*(n+1)/2))
	{
		cout<<"Yes"<<"\n";
		if(2<n)
		{
			cout<<"1"<<" "<<(n+1)/2<<"\n";
		}
		cout<<n-1<<" ";
		i=1;
		while(i!=n+1)
		{
			if(i!=(n+1)/2)
			cout<<i<<" ";
			i++;
		}
		cout<<"\n";
	}
	else
	{
		cout<<"No"<<"\n";
	}

	return 0;
}

int main()
{

		solve();

}


#include<string>
#include<math.h>
#include<iterator>
#include<set>
#include<bits/stdc++.h>
using namespace std;

int solve()
{
	int n,m=INT_MAX,i,k2;

	cin>>n;
	set <int> a,b;
	if(n==2)
	cout<<"No";
	if(n%2==0)
	{
		cout<<"Yes"<<"\n";
		i=1;
		while(i!=n+1)
		{
			if(i%2==1)
			a.insert(i);
			else
			b.insert(i);
			i++;
		}
		cout<<a.size()<<" ";
		set <int>::iterator itr;
		for(itr=a.begin();itr!=a.end();++itr)
		{
			cout<<*itr<<" ";
		}
		cout<<"\n"<<b.size()<<" ";
			for(itr=b.begin();itr!=b.end();++itr)
		{
			cout<<*itr<<" ";
		}
	}
	else if((n*(n+1)/2))
	{
		cout<<"Yes"<<"\n";
		if(2<n)
		{
			cout<<"1"<<" "<<(n+1)/2<<"\n";
		}
		cout<<n-1<<" ";
		i=1;
		while(i!=n+1)
		{
			if(i!=(n+1)/2)
			cout<<i<<" ";
			i++;
		}
		cout<<"\n";
	}
	else
	{
		cout<<"No"<<"\n";
	}

	return 0;
}

int main()
{

		solve();

}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define pb push_back

void solve()
{
    ll n, k;
    cin >> n;

    if (n <= 2)
    {
        cout << "No" << endl;
        return;
    }

    if (n % 2 == 0)
    {
        ll k = n / 2;
    }
    else
    {
        k = (n + 1) / 2;
    }

    cout << "Yes" << endl;

    cout << 1 << " " << k << endl;

    cout << n - 1 << " ";

    for (int i = 1; i <= n; i++)
    {
        if (i != k)
        {
            cout << i << " ";
        }
    }

    cout << endl;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(8);
    ll t(1);
    //    cin >> t;
    while (t--)
    {
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>

#define fi first
#define se second
#define db double
#define U unsigned
#define P std::pair<int,int>
#define LL long long
#define pb push_back
#define MP std::make_pair
#define all(x) x.begin(),x.end()
#define CLR(i,a) memset(i,a,sizeof(i))
#define FOR(i,a,b) for(int i = a;i <= b;++i)
#define ROF(i,a,b) for(int i = a;i >= b;--i)
#define DEBUG(x) std::cerr << #x << '=' << x << std::endl

const int MAXN = 2e5 + 5;

int ch[MAXN][26],tot = 1,fail[MAXN],rt = 1,n;
std::string s[MAXN],t;
LL sm[MAXN];

inline void clear(){
	FOR(i,1,tot) FOR(j,0,25) ch[i][j] = 0;
	FOR(i,1,tot) fail[i] = sm[i] = 0;
	tot = rt = 1;
}

inline void insert(int id){
	int v = rt;
	FOR(i,0,(int)s[id].length()-1){
		int o = s[id][i]-'a';
		if(!ch[v][o]) ch[v][o] = ++tot;
		v = ch[v][o];
	}
	sm[v]++;
}

inline void build(){
	std::queue<int> q;
	FOR(i,0,25){
		if(ch[rt][i]) fail[ch[rt][i]] = rt,q.push(ch[rt][i]);
		else ch[rt][i] = rt;
	}
	while(!q.empty()){
		int v = q.front();q.pop();
		FOR(i,0,25){
			if(ch[v][i]) fail[ch[v][i]] = ch[fail[v]][i],q.push(ch[v][i]);
			else ch[v][i] = ch[fail[v]][i];
		}
	}
	FOR(i,1,tot) sm[i] += sm[fail[i]];
}

LL pre[MAXN],suf[MAXN];

int main(){
	std::ios::sync_with_stdio(false);
	std::cin >> t >> n;
	FOR(i,1,n) std::cin >> s[i];
	FOR(i,1,n) insert(i);build();
	int v = 1;
	FOR(i,0,(int)t.size()-1){
		int o = t[i]-'a';v = ch[v][o];
		pre[i+1] = sm[v];
	}
	clear();
	FOR(i,1,n) std::reverse(all(s[i])),insert(i);build();
	v = 1;
	ROF(i,(int)t.size()-1,0){
		int o = t[i]-'a';v = ch[v][o];
		suf[i+1] = sm[v];
	}
	LL ans = 0;
	FOR(i,1,(int)t.size()-1) ans += 1ll*pre[i]*suf[i+1];
	printf("%lld\n",ans);
	return 0;
}


#include <bits/stdc++.h>

#define fi first
#define se second
#define db double
#define U unsigned
#define P std::pair<int,int>
#define LL long long
#define pb push_back
#define MP std::make_pair
#define all(x) x.begin(),x.end()
#define CLR(i,a) memset(i,a,sizeof(i))
#define FOR(i,a,b) for(int i = a;i <= b;++i)
#define ROF(i,a,b) for(int i = a;i >= b;--i)
#define DEBUG(x) std::cerr << #x << '=' << x << std::endl

const int MAXN = 3e5 + 5;

int ch[MAXN][26],tot = 1,fail[MAXN],rt = 1,n;
std::string s[MAXN],t;
LL sm[MAXN];

inline void clear(){
	FOR(i,1,tot) FOR(j,0,25) ch[i][j] = 0;
	FOR(i,1,tot) fail[i] = sm[i] = 0;
	tot = rt = 1;
}

inline void insert(int id){
	int v = rt;
	FOR(i,0,(int)s[id].length()-1){
		int o = s[id][i]-'a';
		if(!ch[v][o]) ch[v][o] = ++tot;
		v = ch[v][o];
	}
	sm[v]++;
}

inline void build(){
	std::queue<int> q;
	FOR(i,0,25){
		if(ch[rt][i]) fail[ch[rt][i]] = rt,q.push(ch[rt][i]);
		else ch[rt][i] = rt;
	}
	while(!q.empty()){
		int v = q.front();q.pop();
		FOR(i,0,25){
			if(ch[v][i]) fail[ch[v][i]] = ch[fail[v]][i],q.push(ch[v][i]),assert(ch[v][i] >= fail[ch[v][i]]);//,sm[ch[v][i]] += sm[fail[ch[v][i]]];
			else ch[v][i] = ch[fail[v]][i];
		}
	}
	FOR(i,1,tot) sm[i] += sm[fail[i]];
}

LL pre[MAXN],suf[MAXN];

int main(){
	std::ios::sync_with_stdio(false);
	std::cin >> t >> n;
	FOR(i,1,n) std::cin >> s[i];
	FOR(i,1,n) insert(i);build();
	int v = 1;
	FOR(i,0,(int)t.size()-1){
		int o = t[i]-'a';v = ch[v][o];
		pre[i+1] = sm[v];
	}
	clear();
	FOR(i,1,n) std::reverse(all(s[i])),insert(i);build();
	v = 1;
	ROF(i,(int)t.size()-1,0){
		int o = t[i]-'a';v = ch[v][o];
		suf[i+1] = sm[v];
	}
	LL ans = 0;
	FOR(i,1,(int)t.size()-1) ans += 1ll*pre[i]*suf[i+1];
	printf("%lld\n",ans);
	return 0;
}


#include <bits/stdc++.h>

#define fi first
#define se second
#define db double
#define U unsigned
#define P std::pair<int,int>
#define LL long long
#define pb push_back
#define MP std::make_pair
#define all(x) x.begin(),x.end()
#define CLR(i,a) memset(i,a,sizeof(i))
#define FOR(i,a,b) for(int i = a;i <= b;++i)
#define ROF(i,a,b) for(int i = a;i >= b;--i)
#define DEBUG(x) std::cerr << #x << '=' << x << std::endl

const int MAXN = 3e5 + 5;

int ch[MAXN][26],tot = 1,fail[MAXN],rt = 1,n;
std::string s[MAXN],t;
LL sm[MAXN];

inline void clear(){
	FOR(i,1,tot) FOR(j,0,25) ch[i][j] = 0;
	FOR(i,1,tot) fail[i] = sm[i] = 0;
	tot = rt = 1;
}

inline void insert(int id){
	int v = rt;
	FOR(i,0,(int)s[id].length()-1){
		int o = s[id][i]-'a';
		if(!ch[v][o]) ch[v][o] = ++tot;
		v = ch[v][o];
	}
	sm[v]++;
}

inline void build(){
	std::queue<int> q;
	FOR(i,0,25){
		if(ch[rt][i]) fail[ch[rt][i]] = rt,q.push(ch[rt][i]);
		else ch[rt][i] = rt;
	}
	while(!q.empty()){
		int v = q.front();q.pop();
		FOR(i,0,25){
			if(ch[v][i]) fail[ch[v][i]] = ch[fail[v]][i],q.push(ch[v][i]);//,sm[ch[v][i]] += sm[fail[ch[v][i]]];
			else ch[v][i] = ch[fail[v]][i];
		}
	}
	FOR(i,1,tot) sm[i] += sm[fail[i]];
}

LL pre[MAXN],suf[MAXN];

int main(){
	std::ios::sync_with_stdio(false);
	std::cin >> t >> n;
	FOR(i,1,n) std::cin >> s[i];
	FOR(i,1,n) insert(i);build();
	int v = 1;
	FOR(i,0,(int)t.size()-1){
		int o = t[i]-'a';v = ch[v][o];
		pre[i+1] = sm[v];
	}
	clear();
	FOR(i,1,n) std::reverse(all(s[i])),insert(i);build();
	v = 1;
	ROF(i,(int)t.size()-1,0){
		int o = t[i]-'a';v = ch[v][o];
		suf[i+1] = sm[v];
	}
	LL ans = 0;
	FOR(i,1,(int)t.size()-1) ans += 1ll*pre[i]*suf[i+1];
	printf("%lld\n",ans);
	return 0;
}


#include <bits/stdc++.h>

#define fi first
#define se second
#define db double
#define U unsigned
#define P std::pair<int,int>
#define LL long long
#define pb push_back
#define MP std::make_pair
#define all(x) x.begin(),x.end()
#define CLR(i,a) memset(i,a,sizeof(i))
#define FOR(i,a,b) for(int i = a;i <= b;++i)
#define ROF(i,a,b) for(int i = a;i >= b;--i)
#define DEBUG(x) std::cerr << #x << '=' << x << std::endl

const int MAXN = 2e5 + 5;

int ch[MAXN][26],tot = 1,fail[MAXN],rt = 1,n;
std::string s[MAXN],t;
LL sm[MAXN];

inline void clear(){
	FOR(i,1,tot) FOR(j,0,25) ch[i][j] = 0;
	FOR(i,1,tot) fail[i] = sm[i] = 0;
	tot = rt = 1;
}

inline void insert(int id){
	int v = rt;
	FOR(i,0,(int)s[id].length()-1){
		int o = s[id][i]-'a';
		if(!ch[v][o]) ch[v][o] = ++tot;
		v = ch[v][o];
	}
	sm[v]++;
}

inline void build(){
	std::queue<int> q;
	FOR(i,0,25){
		if(ch[rt][i]) fail[ch[rt][i]] = rt,q.push(ch[rt][i]);
		else ch[rt][i] = rt;
	}
	while(!q.empty()){
		int v = q.front();q.pop();
		FOR(i,0,25){
			if(ch[v][i]) fail[ch[v][i]] = ch[fail[v]][i],q.push(ch[v][i]),sm[ch[v][i]] += sm[fail[ch[v][i]]];
			else ch[v][i] = ch[fail[v]][i];
		}
	}
}

LL pre[MAXN],suf[MAXN];

int main(){
	std::ios::sync_with_stdio(false);
	std::cin >> t >> n;
	FOR(i,1,n) std::cin >> s[i];
	FOR(i,1,n) insert(i);build();
	int v = 1;
	FOR(i,0,(int)t.size()-1){
		int o = t[i]-'a';v = ch[v][o];
		pre[i+1] = sm[v];
	}
	clear();
	FOR(i,1,n) std::reverse(all(s[i])),insert(i);build();
	v = 1;
	ROF(i,(int)t.size()-1,0){
		int o = t[i]-'a';v = ch[v][o];
		suf[i+1] = sm[v];
	}
	LL ans = 0;
	FOR(i,1,(int)t.size()-1) ans += 1ll*pre[i]*suf[i+1];
	printf("%lld\n",ans);
	return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <queue>
#include <algorithm>
#define maxn 400021
#define LL long long
using namespace std;
LL n, t, ch[maxn][26], cnt[maxn], tot, l[maxn], r[maxn];
LL fail[maxn];
char s[maxn];
queue<LL>q;
vector<string> g;
void insert(string c){
    LL len = c.length(), rt = 0;
    for(LL i = 0; i < len; i++){
        LL x = c[i] - 'a';
        if(!ch[rt][x])ch[rt][x] = ++tot;
        rt = ch[rt][x];
    }
    cnt[rt]++;
}
void build(){
    q.push(0);
    while(!q.empty()){
        LL u = q.front();q.pop();
        for(LL i = 0; i < 26; i++){
            if(ch[u][i]){
                fail[ch[u][i]] = u == 0 ? 0 : ch[fail[u]][i];
                q.push(ch[u][i]);
            }else ch[u][i] = u == 0 ? 0 : ch[fail[u]][i];
        }
        cnt[u] += cnt[fail[u]];
    }
}

void work(LL pos){
    for(auto a: g)insert(a);
    build();
    LL len = strlen(s);
    LL rt = 0;
    for(LL i = 0; i < len; i++){
        rt = ch[rt][s[i] - 'a'];
        if(pos == 1)l[i] = cnt[rt];
        else r[len - i - 1] = cnt[rt];
    }
}

int main(){
    scanf("%s%I64d", s, &n);
    string a;
    for(LL i = 1; i <= n; i++){
        cin>> a;
        g.push_back(a);
    }
    work(1);
    memset(ch, 0, sizeof(ch));
    memset(fail, 0, sizeof(fail));
    memset(cnt, 0, sizeof(cnt));
    tot = 0;
    LL len = strlen(s);
    reverse(s, s + len);
    for(auto& b: g)reverse(b.begin(), b.end());

    //printf("%s\n", s);
    //for(auto b: g)cout<<b<<endl;

    work(2);
    //for(int i = 0; i < len; i++)printf("%d %d>>\n", l[i], r[i]);
    long long ans = 0;
    for(LL i = 0; i < len ;i++){
        ans += l[i] * r[i + 1];
    }
    cout<<ans;
    return 0;
}/*
cacccbabca
10
cb
ccc
d
c
bc
cc
cbc
cc
dd
ccb
 * */


#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <queue>
#include <algorithm>
#define maxn 200021
using namespace std;
int n, t, ch[maxn][26], cnt[maxn], tot, l[maxn], r[maxn];
int fail[maxn];
char s[maxn];
queue<int>q;
vector<string> g;
void insert(string c){
    int len = c.length(), rt = 0;
    for(int i = 0; i < len; i++){
        int x = c[i] - 'a';
        if(!ch[rt][x])ch[rt][x] = ++tot;
        rt = ch[rt][x];
    }
    cnt[rt]++;
}
void build(){
    q.push(0);
    while(!q.empty()){
        int u = q.front();q.pop();
        for(int i = 0; i < 26; i++){
            if(ch[u][i]){
                fail[ch[u][i]] = u == 0 ? 0 : ch[fail[i]][i];
                q.push(ch[u][i]);
            }else ch[u][i] = u == 0 ? 0 : ch[fail[u]][i];
        }
        cnt[u] += cnt[fail[u]];
    }
}

void work(int pos){
    for(auto a: g)insert(a);
    build();
    int len = strlen(s);
    int rt = 0;
    for(int i = 0; i < len; i++){
        rt = ch[rt][s[i] - 'a'];
        if(pos == 1)l[i] = cnt[rt];
        else r[len - i - 1] = cnt[rt];
    }
}

int main(){
    scanf("%s%d", s, &n);
    string a;
    for(int i = 1; i <= n; i++){
        cin>> a;
        g.push_back(a);
    }
    work(1);
    memset(ch, 0, sizeof(ch));
    memset(fail, 0, sizeof(fail));
    memset(cnt, 0, sizeof(cnt));
    tot = 0;
    int len = strlen(s);
    for(int i = 0; i <= (len - 1) / 2; i++)swap(s[i], s[len - i - 1]);
    for(auto b: g)reverse(b.begin(), b.end());
    work(2);

    long long ans = 0;
    for(int i = 0; i < len ;i++){
        ans += (long long)l[i] * r[i + 1];
    }
    cout<<ans;
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <queue>
#include <algorithm>
#define maxn 400021
#define LL long long
using namespace std;
LL n, t, ch[maxn][26], cnt[maxn], tot, l[maxn], r[maxn];
LL fail[maxn];
char s[maxn];
queue<LL>q;
vector<string> g;
void insert(string c){
    LL len = c.length(), rt = 0;
    for(LL i = 0; i < len; i++){
        LL x = c[i] - 'a';
        if(!ch[rt][x])ch[rt][x] = ++tot;
        rt = ch[rt][x];
    }
    cnt[rt]++;
}
void build(){
    q.push(0);
    while(!q.empty()){
        LL u = q.front();q.pop();
        for(LL i = 0; i < 26; i++){
            if(ch[u][i]){
                fail[ch[u][i]] = u == 0 ? 0 : ch[fail[i]][i];
                q.push(ch[u][i]);
            }else ch[u][i] = u == 0 ? 0 : ch[fail[u]][i];
        }
        cnt[u] += cnt[fail[u]];
    }
}

void work(LL pos){
    for(auto a: g)insert(a);
    build();
    LL len = strlen(s);
    LL rt = 0;
    for(LL i = 0; i < len; i++){
        rt = ch[rt][s[i] - 'a'];
        if(pos == 1)l[i] = cnt[rt];
        else r[len - i - 1] = cnt[rt];
    }
}

int main(){
    scanf("%s%I64d", s, &n);
    string a;
    for(LL i = 1; i <= n; i++){
        cin>> a;
        g.push_back(a);
    }
    work(1);
    memset(ch, 0, sizeof(ch));
    memset(fail, 0, sizeof(fail));
    memset(cnt, 0, sizeof(cnt));
    tot = 0;
    LL len = strlen(s);
    for(LL i = 0; i <= (len - 1) / 2; i++)swap(s[i], s[len - i - 1]);
    for(auto& b: g)reverse(b.begin(), b.end());

    //printf("%s\n", s);
    //for(auto b: g)cout<<b<<endl;

    work(2);
    //for(int i = 0; i < len; i++)printf("%d %d>>\n", l[i], r[i]);
    long long ans = 0;
    for(LL i = 0; i < len ;i++){
        ans += (long long)l[i] * r[i + 1];
    }
    cout<<ans;
    return 0;
}/*
aabab
 3
 a
 ab
 b
 * */


#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <queue>
#include <algorithm>
#define maxn 400021
#define LL long long
using namespace std;
LL n, t, ch[maxn][26], cnt[maxn], tot, l[maxn], r[maxn];
LL fail[maxn];
char s[maxn];
queue<LL>q;
vector<string> g;
void insert(string c){
    LL len = c.length(), rt = 0;
    for(LL i = 0; i < len; i++){
        LL x = c[i] - 'a';
        if(!ch[rt][x])ch[rt][x] = ++tot;
        rt = ch[rt][x];
    }
    cnt[rt]++;
}
void build(){
    q.push(0);
    while(!q.empty()){
        LL u = q.front();q.pop();
        for(LL i = 0; i < 26; i++){
            if(ch[u][i]){
                fail[ch[u][i]] = u == 0 ? 0 : ch[fail[i]][i];
                q.push(ch[u][i]);
            }else ch[u][i] = u == 0 ? 0 : ch[fail[u]][i];
        }
        cnt[u] += cnt[fail[u]];
    }
}

void work(LL pos){
    for(auto a: g)insert(a);
    build();
    LL len = strlen(s);
    LL rt = 0;
    for(LL i = 0; i < len; i++){
        rt = ch[rt][s[i] - 'a'];
        if(pos == 1)l[i] = cnt[rt];
        else r[len - i - 1] = cnt[rt];
    }
}

int main(){
    scanf("%s%I64d", s, &n);
    string a;
    for(LL i = 1; i <= n; i++){
        cin>> a;
        g.push_back(a);
    }
    work(1);
    memset(ch, 0, sizeof(ch));
    memset(fail, 0, sizeof(fail));
    memset(cnt, 0, sizeof(cnt));
    tot = 0;
    LL len = strlen(s);
    for(LL i = 0; i <= (len - 1) / 2; i++)swap(s[i], s[len - i - 1]);
    for(auto b: g)reverse(b.begin(), b.end());
    work(2);

    long long ans = 0;
    for(LL i = 0; i < len ;i++){
        ans += (long long)l[i] * r[i + 1];
    }
    cout<<ans;
    return 0;
}