// ----- In the name of ALLAH, the Most Gracious, the Most Merciful -----

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

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define deb(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define int long long
#define endl "\n"
#define mod 1000000007
#define inf (int)1e18

int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    string s; cin >> s;
    bool ok1=1,ok2=1;

    for(int i=0;i<s.length();i++){
        if((i+1)%2==1){
            ok1 &= (s[i]>='a' and s[i]<='z');
        }else{
            ok2 &= (s[i]>='A' and s[i]<='Z'); 
        }
    }

    if(ok1&&ok2) cout << "Yes" << endl;
    else cout << "No" << endl; 
    
    return 0;
}
#include <bits/stdc++.h>
using namespace std;

// general template {{{
// region
typedef int int_;
#define int int64_t

#define pb push_back
#define pi pair<int,int>
#define vpi vector<pi>
#define vi vector<int>
#define vvi vector<vi>
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define db double

#define sz(x) x.size()
#define watch(x) cout << #x << " : " << x << endl;

template <class A, class B> ostream& operator << (ostream& out, const pair<A, B> &a){
    return out << "(" << a.first << ", " << a.second << ")";
}

template<class A>ostream& operator<<(ostream& out,const vector<A>&v) {
    out << "[";
    for(int i=0;i<sz(v);i++) {
        if(i) out << ", ";
        out << v[i];
    }
    return out << "]" << endl;
}

#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

const int64_t mod = 1e9 + 7;

int Mod(int x) {
    x %= mod;
    if(x<0) x += mod;
    return x;
}

int Pow(int x,int n) {
    if(n == 0) return 1;
    int t = Pow(x,n/2);
    t = Mod(t*t);
    if(n&1) t = Mod(t*x);
    return t;
}

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

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

    vvi g(n+1);

    for(int i=0;i<n;i++) {
        g[i].pb((2*i)%n);
        g[i].pb((2*i + 1)%n);
    }

    for(int i=1;i<=n;i++) {
        // cout << i << " : ";
        for(int x:g[i-1]) cout << x+1 << " ";
        cout << endl;
    }
}
