#include <bits/stdc++.h>
using namespace std;
int n;
pair<int, int> z[300005];
int s[300005], t[300005];
long long ss, st;
vector<pair<pair<int, int>, int> > r;
int main() {
  scanf("%d", &n);
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) {
    int a;
    scanf("%d", &a);
    ss += a;
    z[i] = make_pair(a, i);
  }
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) scanf("%d", t + i), st += t[i];
  if (ss != st) {
    puts("NO");
    return 0;
  }
  sort(z, z + n);
  sort(t, t + n);
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) s[i] = z[i].first;
  int j = 0;
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) {
    if (s[i] > t[i]) {
      puts("NO");
      return 0;
    }
    j = max(j, i + 1);
    while (s[i] < t[i]) {
      while (s[j] <= t[j]) j++;
      int d = min(t[i] - s[i], s[j] - t[j]);
      r.push_back(make_pair(make_pair(z[i].second, z[j].second), d));
      s[i] += d;
      s[j] -= d;
    }
  }
  printf("YES\n%d\n", ((int)(r).size()));
  for (auto p : r)
    printf("%d %d %d\n", p.first.first + 1, p.first.second + 1, p.second);
  return 0;
}
