Problem: Students went into a class to write a test and sat in some way. The teacher thought: "Probably they sat in this order to copy works of each other. I need to rearrange them in such a way that students that were neighbors are not neighbors in a new seating."

The class can be represented as a matrix with n rows and m columns with a student in each cell. Two students are neighbors if cells in which they sit have a common side.

Let's enumerate students from 1 to n·m in order of rows. So a student who initially sits in the cell in row i and column j has a number (i - 1)·m + j. You have to find a matrix with n rows and m columns in which all numbers from 1 to n·m appear exactly once and adjacent numbers in the original matrix are not adjacent in it, or determine that there is no such matrix.

Input

The only line contains two integers n and m (1 ≤ n, m ≤ 105; n·m ≤ 105) — the number of rows and the number of columns in the required matrix.

Output

If there is no such matrix, output "NO" (without quotes). 

Otherwise in the first line output "YES" (without quotes), and in the next n lines output m integers which form the required matrix.

Examples

Input

2 4


Output

YES
5 4 7 2 
3 6 1 8 


Input

2 1


Output

NO

Note

In the first test case the matrix initially looks like this:
    
    
      
    1 2 3 4  
    5 6 7 8  
    

It's easy to see that there are no two students that are adjacent in both matrices.

In the second test case there are only two possible seatings and in both of them students with numbers 1 and 2 are neighbors.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const int INF = (int)(1e9 + 1e5);
const long long LINF = (long long)(1e18);
const double EPS = 1e-9;
const int MOD = 1000000007;
const int BASE = 1000003;
const int MAXN = 100500;
struct field {
  int n, m;
  vector<vector<int>> cells;
};
field st, res;
void print(field st) {
  for (int i = 1; i <= st.n; ++i) {
    for (int j = 1; j <= st.m; ++j) {
      printf("%d ", st.cells[i][j]);
    }
    printf("\n");
  }
  fflush(stdout);
}
field mirror(field st) {
  field res;
  res.n = st.m;
  res.m = st.n;
  res.cells.resize(res.n + 1);
  for (int i = 0; i <= res.n; ++i) {
    res.cells[i].resize(res.m + 1, 0);
  }
  for (int i = 1; i <= res.n; ++i) {
    for (int j = 1; j <= res.m; ++j) {
      res.cells[i][j] = st.cells[j][i];
    }
  }
  return res;
}
field shuffle(field st) {
  bool mirrored = false;
  if (st.n > st.m) {
    st = mirror(st);
    mirrored = true;
  }
  field res = st;
  if (res.n == 1) {
    int pos = (st.m + 1) / 2;
    for (int j = 1; j <= st.m; j += 2) {
      res.cells[1][pos--] = st.cells[1][j];
    }
    pos = (st.m + 1) / 2 + 1;
    for (int j = st.m / 2 * 2; j > 0; j -= 2) {
      res.cells[1][pos++] = st.cells[1][j];
    }
  } else if (res.n == 2) {
    for (int j = 2; j <= st.m; j += 2) {
      swap(res.cells[2][j], res.cells[1][j]);
    }
    int c1 = res.cells[1][1], c2 = res.cells[1][2];
    for (int j = 1; j + 2 <= st.m; ++j) {
      res.cells[1][j] = res.cells[1][j + 2];
    }
    res.cells[1][st.m - 1] = c1;
    res.cells[1][st.m] = c2;
  } else {
    int sh = 1;
    for (int j = 1; j <= st.m; ++j) {
      vector<int> col;
      int num = j;
      for (int i = 1; i <= st.n; ++i) {
        col.push_back(st.cells[i][num]);
        ++num;
        if (num > st.m) {
          num -= st.m;
        }
      }
      for (int i = 0; i < col.size(); ++i) {
        res.cells[sh][j] = col[i];
        ++sh;
        if (sh > st.n) {
          sh -= st.n;
        }
      }
      sh += 2;
      if (sh > st.n) {
        sh -= st.n;
      }
    }
  }
  if (mirrored) {
    res = mirror(res);
  }
  return res;
}
void init() {
  scanf("%d%d", &st.n, &st.m);
  st.cells.resize(st.n + 1);
  for (int i = 0; i <= st.n; ++i) {
    st.cells[i].resize(st.m + 1, 0);
  }
  int cnt = 0;
  for (int i = 1; i <= st.n; ++i) {
    for (int j = 1; j <= st.m; ++j) {
      st.cells[i][j] = ++cnt;
    }
  }
}
pair<int, int> get_edge(int a, int b) {
  if (a > b) {
    swap(a, b);
  }
  return pair<int, int>(a, b);
}
vector<pair<int, int>> get_all_edges(field& f1) {
  vector<pair<int, int>> st;
  for (int i = 1; i <= f1.n; ++i) {
    for (int j = 1; j < f1.m; ++j) {
      int a = f1.cells[i][j], b = f1.cells[i][j + 1];
      st.push_back(get_edge(a, b));
    }
  }
  for (int j = 1; j <= f1.m; ++j) {
    for (int i = 1; i < f1.n; ++i) {
      int a = f1.cells[i][j], b = f1.cells[i + 1][j];
      st.push_back(get_edge(a, b));
    }
  }
  return st;
}
bool check(field f1, field f2) {
  set<pair<int, int>> st;
  auto v1 = get_all_edges(f1);
  auto v2 = get_all_edges(f2);
  for (int i = 0; i < v1.size(); ++i) {
    st.insert(v1[i]);
  }
  for (int i = 0; i < v2.size(); ++i) {
    if (st.count(v2[i])) {
      cerr << v2[i].first << " " << v2[i].second << endl;
      return false;
    }
  }
  return true;
}
void solve() {
  init();
  if (st.n == 1 && st.m == 1) {
    printf("YES\n");
    print(st);
    return;
  }
  if (min(st.n, st.m) <= 2 && max(st.n, st.m) <= 3) {
    printf("NO\n");
    return;
  }
  res = shuffle(st);
  assert(check(st, res));
  printf("YES\n");
  print(res);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int tests = 1;
  for (int test = 1; test <= tests; test++) {
    solve();
  }
  return 0;
}