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;
void readi(int &x) {
  int v = 0, f = 1;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-')
    f = -1;
  else
    v = v * 10 + c - '0';
  while (isdigit(c = getchar())) v = v * 10 + c - '0';
  x = v * f;
}
void readll(long long &x) {
  long long v = 0ll, f = 1ll;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-')
    f = -1;
  else
    v = v * 10 + c - '0';
  while (isdigit(c = getchar())) v = v * 10 + c - '0';
  x = v * f;
}
void readc(char &x) {
  char c;
  while ((c = getchar()) == ' ')
    ;
  x = c;
}
void writes(string s) { puts(s.c_str()); }
void writeln() { writes(""); }
void writei(int x) {
  if (!x) putchar('0');
  char a[25];
  int top = 0;
  while (x) {
    a[++top] = (x % 10) + '0';
    x /= 10;
  }
  while (top) {
    putchar(a[top]);
    top--;
  }
}
void writell(long long x) {
  if (!x) putchar('0');
  char a[25];
  int top = 0;
  while (x) {
    a[++top] = (x % 10) + '0';
    x /= 10;
  }
  while (top) {
    putchar(a[top]);
    top--;
  }
}
long long qp(long long x, long long y) {
  if (y == 0) return 1;
  if (y == 1) return x;
  long long z = qp(x, y / 2);
  z = z * z % 1000000007;
  if (y & 1) z = z * x % 1000000007;
  return z;
}
int n, m, i, j, a[100005], b[5][5], c[100005];
vector<vector<int> > ans;
int main() {
  cin >> n >> m;
  if (m == 4) {
    if (n == 1) {
      cout << "YES\n2 4 1 3";
      return 0;
    }
    if (n == 2) {
      cout << "YES\n5 4 7 2\n3 6 1 8";
      return 0;
    }
    if (n == 3) {
      cout << "YES\n1 7 5 9\n10 2 12 3\n4 8 6 11";
      return 0;
    }
    if (n == 4) {
      cout << "YES\n1 4 11 8\n10 7 2 5\n3 16 9 14\n6 13 15 12";
      return 0;
    }
  }
  if (n == 4) {
    if (m == 1) {
      cout << "YES\n2\n4\n1\n3\n";
      return 0;
    }
    if (m == 2) {
      cout << "YES\n2 5\n7 4\n6 1\n3 8";
      return 0;
    }
    if (m == 3) {
      cout << "YES\n1 10 4\n7 2 8\n5 12 6\n9 3 11";
      return 0;
    }
  }
  if (n <= 3 && m <= 3) {
    for (i = 1; i <= m * n; i++) a[i] = i;
    do {
      int cnt = 0;
      for (i = 1; i <= n; i++) {
        for (j = 1; j <= m; j++) {
          b[i][j] = a[++cnt];
        }
      }
      bool ok = 1;
      for (i = 1; i <= n && ok; i++) {
        for (j = 1; j <= m; j++) {
          if (b[i][j + 1] && b[i][j + 1] == b[i][j] + 1) {
            ok = 0;
            break;
          }
          if (b[i][j + 1] && b[i][j + 1] == b[i][j] - 1) {
            ok = 0;
            break;
          }
          if (b[i][j + 1] && b[i][j + 1] == b[i][j] + m) {
            ok = 0;
            break;
          }
          if (b[i][j + 1] && b[i][j + 1] == b[i][j] - m) {
            ok = 0;
            break;
          }
          if (b[i][j - 1] && b[i][j - 1] == b[i][j] + 1) {
            ok = 0;
            break;
          }
          if (b[i][j - 1] && b[i][j - 1] == b[i][j] - 1) {
            ok = 0;
            break;
          }
          if (b[i][j - 1] && b[i][j - 1] == b[i][j] + m) {
            ok = 0;
            break;
          }
          if (b[i][j - 1] && b[i][j - 1] == b[i][j] - m) {
            ok = 0;
            break;
          }
          if (b[i + 1][j] && b[i + 1][j] == b[i][j] + 1) {
            ok = 0;
            break;
          }
          if (b[i + 1][j] && b[i + 1][j] == b[i][j] - 1) {
            ok = 0;
            break;
          }
          if (b[i + 1][j] && b[i + 1][j] == b[i][j] + m) {
            ok = 0;
            break;
          }
          if (b[i + 1][j] && b[i + 1][j] == b[i][j] - m) {
            ok = 0;
            break;
          }
          if (b[i - 1][j] && b[i - 1][j] == b[i][j] + 1) {
            ok = 0;
            break;
          }
          if (b[i - 1][j] && b[i - 1][j] == b[i][j] - 1) {
            ok = 0;
            break;
          }
          if (b[i - 1][j] && b[i - 1][j] == b[i][j] + m) {
            ok = 0;
            break;
          }
          if (b[i - 1][j] && b[i - 1][j] == b[i][j] - m) {
            ok = 0;
            break;
          }
        }
      }
      if (ok) {
        cout << "YES\n";
        for (i = 1; i <= n; i++) {
          for (j = 1; j <= m; j++) {
            cout << b[i][j] << ' ';
          }
          cout << endl;
        }
        return 0;
      }
    } while (next_permutation(a + 1, a + n * m + 1));
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  if (n == 3 && (m % 2 == 0)) {
    for (i = 1; i <= n; i++) {
      if (i & 1) {
        for (j = 1; j <= m; j += 2) cout << (i - 1) * m + j << ' ';
        for (j = 2; j <= m; j += 2) cout << (i - 1) * m + j << ' ';
      } else {
        for (j = 2; j <= m; j += 2) cout << (i - 1) * m + j << ' ';
        for (j = 1; j <= m; j += 2) cout << (i - 1) * m + j << ' ';
      }
      cout << endl;
    }
    return 0;
  }
  if (m == 3 && (n % 2 == 0)) {
    for (i = 1; i <= m; i++) {
      vector<int> e;
      ans.push_back(e);
      if (i & 1) {
        for (j = 1; j <= n; j += 2) ans.back().push_back((i - 1) * n + j);
        for (j = 2; j <= n; j += 2) ans.back().push_back((i - 1) * n + j);
      } else {
        for (j = 2; j <= n; j += 2) ans.back().push_back((i - 1) * n + j);
        for (j = 1; j <= n; j += 2) ans.back().push_back((i - 1) * n + j);
      }
    }
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        cout << ans[j][i] << ' ';
      }
      cout << endl;
    }
    return 0;
  }
  if (m > 4) {
    int cnt = 0;
    for (i = 1; i <= (m + 1) / 2; i++) {
      a[++cnt] = i;
      a[++cnt] = i + (m + 1) / 2;
    }
    if (m % 2 == 0) {
      for (i = 1; i <= n; i++) {
        reverse(a + 1, a + m + 1);
        for (j = 1; j <= m; j++) {
          cout << (i - 1) * m + a[j] << ' ';
        }
        cout << endl;
      }
      return 0;
    } else {
      int cnt = 0;
      for (i = 1; i <= m / 2; i++) {
        c[++cnt] = i + (m + 1) / 2 - 1;
        c[++cnt] = i;
      }
      c[++cnt] = m;
      for (i = 1; i <= n; i++) {
        for (j = 1; j <= m; j++) {
          if (i & 1)
            cout << (i - 1) * m + c[j] << ' ';
          else
            cout << (i - 1) * m + a[j] << ' ';
        }
        cout << endl;
      }
      return 0;
    }
  } else {
    swap(n, m);
    int cnt = 0;
    for (i = 1; i <= (m + 1) / 2; i++) {
      a[++cnt] = i;
      a[++cnt] = i + (m + 1) / 2;
    }
    if (m % 2 == 0) {
      for (i = 1; i <= n; i++) {
        reverse(a + 1, a + m + 1);
        vector<int> e;
        ans.push_back(e);
        for (j = 1; j <= m; j++) {
          ans.back().push_back((i - 1) * m + a[j]);
        }
      }
    } else {
      int cnt = 0;
      for (i = 1; i <= m / 2; i++) {
        c[++cnt] = i + (m + 1) / 2 - 1;
        c[++cnt] = i;
      }
      c[++cnt] = m;
      for (i = 1; i <= n; i++) {
        vector<int> e;
        ans.push_back(e);
        for (j = 1; j <= m; j++) {
          if (i & 1)
            ans.back().push_back((i - 1) * m + c[j]);
          else
            ans.back().push_back((i - 1) * m + a[j]);
        }
      }
    }
    swap(n, m);
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        cout << ans[j][i] << ' ';
      }
      cout << endl;
    }
  }
  return 0;
}