public static boolean isOk(final String path, final int w, final int h, String b) {
		final String goal = getGoal(b);
		for (int j = 0; j < path.length(); j++) {
			switch (path.charAt(j)) {
			case 'L':
				b = move(Direction.LEFT, w, h, b);
				break;
			case 'R':
				b = move(Direction.RIGHT, w, h, b);
				break;
			case 'U':
				b = move(Direction.UP, w, h, b);
				break;
			case 'D':
				b = move(Direction.DOWN, w, h, b);
				break;
			default:
				Logger.getLogger(Util.class.getName()).log(Level.WARNING, "不正な文字{0}が含まれています：{1}",
						new Object[] { path.charAt(j), path });
				return false;
			}
			if (b == null) {
				Logger.getLogger(Util.class.getName()).log(Level.WARNING, "不可能な動き{0}が指定されました：{1}",
						new Object[] { path.substring(0, j + 1), b });
				return false;
			}
		}
		return b.equals(goal);
	}