#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;
}
