#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
pair<int, int> a[N];
int b[N], c[N];
vector<pair<pair<int, int>, int>> ans;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i].first);
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  sort(b + 1, b + n + 1);
  long long s = 0;
  for (int i = 1; i <= n; i++) {
    c[i] = b[i] - a[i].first;
    s += c[i];
    if (s < 0) {
      puts("NO");
      return 0;
    }
  }
  if (s != 0) {
    puts("NO");
    return 0;
  }
  for (int i = 1, j = 1; i <= n; i++) {
    while (c[i] > 0) {
      j = max(i + 1, j);
      while (c[j] >= 0) j++;
      int d = min(c[i], -c[j]);
      ans.push_back(make_pair(make_pair(a[i].second, a[j].second), d));
      c[i] -= d, c[j] += d;
    }
  }
  puts("YES");
  printf("%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);
  }
  return 0;
}
