#include <bits/stdc++.h>
using namespace std;
int const N = 3e5 + 10;
pair<int, int> x[N];
int y[N], dif[N], j;
vector<pair<pair<int, int>, int> > ans;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &x[i].first), x[i].second = i;
  sort(x + 1, x + 1 + n);
  for (int i = 1; i <= n; i++) scanf("%d", y + i);
  sort(y + 1, y + 1 + n);
  for (int i = 1; i <= n; i++) {
    if (x[i].first <= y[i])
      dif[i] = y[i] - x[i].first;
    else {
      int h = x[i].first - y[i];
      while (h) {
        while (j < i && dif[j] == 0) j++;
        if (j == i) break;
        int m = min(h, dif[j]);
        h -= m;
        dif[j] -= m;
        ans.push_back(make_pair(make_pair(x[j].second, x[i].second), m));
      }
      if (h) return puts("NO") * 0;
    }
  }
  for (int i = 1; i <= n; i++)
    if (dif[i]) return puts("NO") * 0;
  printf("YES\n%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++)
    printf("%d %d %d\n", ans[i].first.first, ans[i].first.second,
           ans[i].second);
}
