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>
using namespace std;
bool ok(long long int j, long long int i, long long int n, long long int m) {
  return ((j >= 1 && j <= n) && ((i >= 1) && (i <= m)));
}
bool neigh(long long int a, long long int b, long long int m) {
  if (min(a, b) % m == 0 && ((max(a, b) - min(a, b)) == 1)) return false;
  if (abs(a - b) == 1 || (abs(a - b) == m)) return true;
  return false;
}
void announce(long long int n, long long int m,
              vector<vector<long long int>> arr) {
  bool k = true;
  for (long long int j = 1; j <= n; j++) {
    for (long long int i = 1; i <= m; i++) {
      if (ok(j - 1, i, n, m)) {
        if (neigh(arr[j][i], arr[j - 1][i], m)) {
          k = false;
        }
      }
      if (ok(j + 1, i, n, m)) {
        if (neigh(arr[j][i], arr[j + 1][i], m)) {
          k = false;
        }
      }
      if (ok(j, i - 1, n, m)) {
        if (neigh(arr[j][i], arr[j][i - 1], m)) {
          k = false;
        }
      }
      if (ok(j, i + 1, n, m)) {
        if (neigh(arr[j][i], arr[j][i + 1], m)) {
          k = false;
        }
      }
    }
  }
  assert(k);
  cout << "YES\n";
  for (long long int j = 1; j <= n; j++) {
    for (long long int i = 1; i <= m; i++) {
      cout << arr[j][i] << " ";
    }
    cout << '\n';
  }
  exit(0);
}
void brute(long long int n, long long int m) {
  vector<vector<long long int>> arr(n + 1, vector<long long int>(m + 1));
  if (max(n, m) < 4) {
    if (min(n, m) == 1) {
      cout << "NO\n";
      exit(0);
    }
    vector<long long int> p(n * m);
    long long int curr = 1;
    for (long long int j = 0; j < n * m; j++) {
      p[j] = curr++;
    }
    while (true) {
      long long int curr = 0;
      for (long long int j = 1; j <= n; j++) {
        for (long long int i = 1; i <= m; i++) {
          arr[j][i] = p[curr++];
        }
      }
      bool k = true;
      for (long long int j = 1; j <= n; j++) {
        for (long long int i = 1; i <= m; i++) {
          if (ok(j - 1, i, n, m)) {
            if (neigh(arr[j][i], arr[j - 1][i], m)) {
              k = false;
            }
          }
          if (ok(j + 1, i, n, m)) {
            if (neigh(arr[j][i], arr[j + 1][i], m)) {
              k = false;
            }
          }
          if (ok(j, i - 1, n, m)) {
            if (neigh(arr[j][i], arr[j][i - 1], m)) {
              k = false;
            }
          }
          if (ok(j, i + 1, n, m)) {
            if (neigh(arr[j][i], arr[j][i + 1], m)) {
              k = false;
            }
          }
        }
      }
      if (k) {
        announce(n, m, arr);
      }
      if (!(next_permutation(p.begin(), p.end()))) break;
    }
    cout << "NO\n";
    exit(0);
  } else {
    if (min(n, m) == 1) {
      if (n == 1) {
        cout << "YES\n";
        cout << 2 << " " << 4 << " " << 1 << " " << 3 << '\n';
        exit(0);
      } else {
        cout << "YES\n";
        cout << 2 << "\n" << 4 << "\n" << 1 << "\n" << 3 << '\n';
        exit(0);
      }
    } else if (min(n, m) == 2) {
      if (n == 2) {
        vector<vector<long long int>> v = {
            {}, {0, 5, 4, 7, 2}, {0, 3, 6, 1, 8}};
        announce(n, m, v);
      } else {
        vector<vector<long long int>> v = {
            {}, {0, 1, 4}, {0, 5, 8}, {0, 2, 3}, {0, 6, 7}};
        announce(n, m, v);
      }
    } else if (min(n, m) == 3) {
      vector<vector<long long int>> v(5, vector<long long int>(5));
      v[1] = {0, 1, 3, 5};
      v[2] = {0, 6, 8, 10};
      v[3] = {0, 2, 4, 12};
      v[4] = {0, 9, 11, 7};
      cout << "YES\n";
      if (n == 4) {
        for (long long int j = 1; j <= n; j++) {
          for (long long int i = 1; i <= m; i++) {
            cout << v[j][i] << " ";
          }
          cout << '\n';
        }
      } else {
        cout << 1 << " " << 3 << " " << 5 << " " << 2 << '\n';
        cout << 4 << " " << 6 << " " << 12 << " " << 9 << '\n';
        cout << 11 << " " << 8 << " " << 10 << " " << 7 << '\n';
      }
      exit(0);
    } else {
      vector<vector<long long int>> v(n + 1, vector<long long int>(m + 1));
      v[1] = {0, 5, 4, 7, 2};
      v[2] = {0, 3, 6, 1, 8};
      for (long long int j = 3; j <= 4; j++) {
        for (long long int i = 1; i <= 4; i++) {
          v[j][i] = v[j - 2][i] + 8;
        }
      }
      announce(n, m, v);
    }
  }
}
void solve() {
  long long int n, m;
  cin >> n >> m;
  vector<vector<long long int>> arr(n + 1, vector<long long int>(m + 1));
  vector<vector<long long int>> out(n + 1, vector<long long int>(m + 1));
  if (n == 1 && m == 1) {
    cout << "YES\n";
    cout << 1 << '\n';
    return;
  }
  for (long long int j = 1; j <= n; j++) {
    for (long long int i = 1; i <= m; i++) {
      arr[j][i] = (j - 1) * m + i;
    }
  }
  if (max(n, m) <= 4) {
    brute(n, m);
  }
  cout << "YES\n";
  if (max(n, m) == m) {
    vector<long long int> p1(m + 1), p2(m + 1);
    long long int curr = 1;
    for (long long int j = 1; j <= m; j += 2) {
      p1[j] = curr;
      curr++;
    }
    for (long long int j = 2; j <= m; j += 2) {
      p1[j] = curr;
      curr++;
    }
    curr = 1;
    for (long long int j = 2; j <= m; j += 2) {
      p2[j] = curr;
      curr++;
    }
    for (long long int j = 1; j <= m; j += 2) {
      p2[j] = curr;
      curr++;
    }
    for (long long int j = 1; j <= n; j++) {
      if (j % 2) {
        for (long long int i = 1; i <= m; i++) {
          out[j][i] = arr[j][p1[i]];
        }
      } else {
        for (long long int i = 1; i <= m; i++) {
          out[j][i] = arr[j][p2[i]];
        }
      }
    }
  } else {
    long long int curr = 1;
    vector<long long int> p1(n + 1), p2(n + 1);
    for (long long int j = 1; j <= n; j += 2) {
      p1[j] = curr;
      curr++;
    }
    for (long long int j = 2; j <= n; j += 2) {
      p1[j] = curr;
      curr++;
    }
    curr = 1;
    for (long long int j = 2; j <= n; j += 2) {
      p2[j] = curr;
      curr++;
    }
    for (long long int j = 1; j <= n; j += 2) {
      p2[j] = curr;
      curr++;
    }
    for (long long int i = 1; i <= m; i++) {
      for (long long int j = 1; j <= n; j++) {
        if (i % 2) {
          out[j][i] = arr[p1[j]][i];
        } else {
          out[j][i] = arr[p2[j]][i];
        }
      }
    }
  }
  for (long long int j = 1; j <= n; j++) {
    for (long long int i = 1; i <= m; i++) {
      cout << out[j][i] << " ";
    }
    cout << '\n';
  }
  return;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}