import 'dart:convert';
import 'dart:io';
import 'dart:async';

main() async {
  var k = int.parse(stdin.readLineSync());
  var lines = stdin.transform(utf8.decoder).transform(LineSplitter());

  List<int> ab = [];
  List<int> prev = [0, 0, 0];
  int diff = 0;
  int dis = 0;
  await for (var line in lines) {
    ab = line.split(" ").map((x) => int.parse(x)).toList();
  }
  if((ab[0] <= k) && (k <= ab[1])) {
  	print('OK');
  } else {
  	print('NG');
  }
}
